-
-
Save alisdair/5670341 to your computer and use it in GitHub Desktop.
(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]); | |
} | |
} | |
})(); |
for (var i in elements.length) {
!
For Each > For.
Brilliant on mobile. Adding a bookmarklet is a bit of a pain on iOS; I used these directions: https://apple.stackexchange.com/a/74208/22536. I had no problem copying the formatted JS text from the article and prefixing it with "javascript:" when editing the bookmark.
elements[i].style.position = 'absolute'
isn't that better? So you don't have to refresh the page if your nav was sticky
You might also want to check for position sticky since that has decent support now.
yes, what @terwanerik said, but I'd suggest 'static'
instead of absolute.
extension doesn't work in twitter :\
This also kills headers that use position: sticky
:
if (["sticky", "fixed"].includes(getComputedStyle(elements[i]).position)) {
(line 5)
Is it at all possible to adapt this to a Stylus/Stylish script?
Mozilla broke the code I was using to make this a standalone button. Had to install the kill sticky addon to get it back
The bookmarklet still works fine so the war on sticky/fixed objects continues.
Loved the sticky header on the new site. Loved killing it even more.
Thanks for this!
https://alisdair.mcdiarmid.org/kill-sticky-headers/