Changes

no edit summary
Line 65: Line 65:       −
var didScroll = false;
+
window.onscroll = function() {scrollFunction()};
   −
$(window).scroll(function() {
+
function scrollFunction() {
−
    didScroll = true;
+
  if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
−
});
+
     document.getElementById("mw-header-container").style.background = "white";
−
 
+
  } else {
−
setInterval(function() {
+
    document.getElementById("mw-header-container").style.background = "black";
−
     if ( didScroll ) {
+
  }
−
        didScroll = false;
+
}
−
        var $el;
  −
 
  −
        //Same that all the if else statements
  −
        switch (true) {
  −
            case (scroll >= 100):
  −
                $el = $('#mw-header-container');
  −
                break;
  −
 
  −
        }
  −
        $el.addClass('headerblur');
  −
    }
  −
}, 50);