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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -