Skip to content

Instantly share code, notes, and snippets.

@frippz frippz/unSticky.js
Last active Sep 23, 2019

What would you like to do?
Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
(function () {
const elements = document.querySelectorAll('body *');
const body = document.querySelector('body');
if (getComputedStyle(body).overflow === 'hidden') { = 'unset';
elements.forEach(function (element) {
if (['-webkit-sticky', 'sticky'].includes(getComputedStyle(element).position)) { = 'unset';
else if(['fixed'].includes(getComputedStyle(element).position)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.