jQuery - show element by default and hide upon scroll

0 votes
159 views
added Jan 30, 2019 in jQuery by LC Marshal Captain (25,770 points)
$(window).scroll(function() {
 var header19 = $('#header_2k19');
 $(header19).show();
 if ($(this).scrollTop()>0) {
   $(header19).hide();
 }
 else {
   $(header19).show();
 }
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...