Skip to content

Instantly share code, notes, and snippets.

Avatar

Joacim de la Motte jlowgren

View GitHub Profile
@jlowgren
jlowgren / unSticky.js
Last active Sep 23, 2019 — forked from frippz/unSticky.js
Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
View unSticky.js
const elements = document.querySelectorAll('body *');
const body = document.querySelector('body');
if (getComputedStyle(body).overflow === 'hidden') {
body.style.overflow = "unset";
}
elements.forEach((element) => {
if (['-webkit-sticky', 'sticky'].includes(getComputedStyle(element).position)) {
element.style.position = 'unset';