Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
const elements = document.querySelectorAll('body *');
const containers = document.querySelectorAll('html, body');
containers.forEach(el => {
if (getComputedStyle(el).overflow === 'hidden') {
el.style.setProperty ('overflow', 'unset', 'important');
}
});
elements.forEach(function (element) {
if (["-webkit-sticky", "sticky"].includes(getComputedStyle(element).position)) {
element.style.position = "unset";
}
else if(["fixed"].includes(getComputedStyle(element).position)) {
element.parentNode.removeChild(element);
}
});
@jlowgren

This comment has been minimized.

Copy link

@jlowgren jlowgren commented Sep 8, 2020

const containers = document.querySelectorAll('html, body');

containers.forEach(el => {
  if (getComputedStyle(el).overflow === 'hidden') {
    el.style.setProperty ('overflow', 'unset', 'important');
  }
})
@frippz

This comment has been minimized.

Copy link
Owner Author

@frippz frippz commented Sep 8, 2020

What would I do without you, @jlowgren? 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment