Skip to content

Instantly share code, notes, and snippets.

@maxnatt
Last active January 2, 2023 19:48
Show Gist options
  • Save maxnatt/396ae59d7f683f4a6867a1b7fdb7cf07 to your computer and use it in GitHub Desktop.
Save maxnatt/396ae59d7f683f4a6867a1b7fdb7cf07 to your computer and use it in GitHub Desktop.
sticky
/// kill.js
document.querySelectorAll('body *').forEach(function(node) {
if (['fixed', 'sticky'].includes(getComputedStyle(node).position)) {
node.parentNode.removeChild(node);
}
});
document.querySelectorAll('html *').forEach(function(node) {
var s = getComputedStyle(node);
if ('hidden' === s['overflow']) { node.style['overflow'] = 'visible'; }
if ('hidden' === s['overflow-x']) { node.style['overflow-x'] = 'visible'; }
if ('hidden' === s['overflow-y']) { node.style['overflow-y'] = 'visible'; }
});
var htmlNode = document.querySelector('html');
htmlNode.style['overflow'] = 'visible';
htmlNode.style['overflow-x'] = 'visible';
htmlNode.style['overflow-y'] = 'visible';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment