Skip to content

Instantly share code, notes, and snippets.

@drbraden
Forked from alisdair/kill-sticky.js
Last active July 10, 2019 10:57
Show Gist options
  • Save drbraden/64fe71860547815074242e3e71be43d2 to your computer and use it in GitHub Desktop.
Save drbraden/64fe71860547815074242e3e71be43d2 to your computer and use it in GitHub Desktop.
Kill sticky headers and re-enable scrolling
// Original gist from https://alisdair.mcdiarmid.org/kill-sticky-headers/ (thank you!)
// My only addition is re-enabling scrolling since some sites disable it while
// their pop-up is active.
// Just copy the below and paste it at http://mrcoles.com/bookmarklet/ to
// properly escape the string and create a convenient "this link" that can
// be dragged to the bookmark bar. A more advanced version, also written
// by Mr. Coles, is available on npm: npm -g install bookmarklet
var i, elements = document.querySelectorAll('body *');
for (i = 0; i < elements.length; i++) {
if (getComputedStyle(elements[i]).position === 'fixed') {
elements[i].parentNode.removeChild(elements[i]);
}
}
document.body.style.height = "100%";
document.body.style.overflow = "auto";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment