javascript - ScrollTop bug jquery On chrome -


in website made sticky header.

it works on every browsers when test on macbook on chrome there's bug scrolltop

i've main header , sticky header :

i code :

$(document).on('scroll',function() {         if ($(document).scrolltop() >= 150) {         $('header:not(.sticky)').hide();         $('header.sticky').show();     } else {         $('header:not(.sticky)').show();         $('header.sticky').hide();     } }); 

when scroll 150px jumps top of page.

thanks !

this works fine in chrome in mac machine

  $(document).scroll(()=> {     if($(this).scrolltop()>= 150) {       //your actions      }     else {       //your actions     }   }); 

Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -