Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1019 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 1019 Bytes

Kill Sticky

This is an updated version of Alisdair McDiarmid's most excellent Kill Sticky Headers.

It's a bookmarklet (a javascript function you can add to your bookmarks bar) that removes sticky elements in a webpage.

Add a new bookmark, and use the code below as the URL.

Code

(javascript:void function(){(function(){var e,o=document.querySelectorAll("body *");for(e=0;e<o.length;e++){var t=getComputedStyle(o[e]).position;("fixed"===t||"sticky"===t)%26%26o[e].parentNode.removeChild(o[e])}})()}();

Formatted javascript

(function () {
  var i, elements = document.querySelectorAll('body *');

  for (i = 0; i < elements.length; i++) {
    var pos = getComputedStyle(elements[i]).position;
    if (pos === 'fixed' || pos === 'sticky') {
      elements[i].parentNode.removeChild(elements[i]);
    }
  }
})();

Files