3 ms·
NTHNer but here is the one I use. It's old but it still works a treat: https://alisdair.mcdiarmid.org/kill-sticky-headers/ https://alisdair.mcdiarmid.org/kill-s
by jabroni_salad 4y ago
NTHNer but here is the one I use. It's old but it still works a treat: https://alisdair.mcdiarmid.org/kill-sticky-headers/ https://alisdair.mcdiarmid.org/kill-sticky-headers/
(function () {
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]);
}
}
})();
- err4nt 4y agoI rewrote this to be a little more succinct: document.querySelectorAll('body *').forEach(tag => getComputedStyle(tag).position === 'fixed' && tag.remove() ); - you can use `forEach()` on the NodeList that `querySelectorAll()` returns - you can use `remove()` directly on the DOM node you want to remove
- Xeanort 4y agoHere for an improved version: https://github.com/t-mart/kill-sticky https://github.com/t-mart/kill-sticky