Answers for "jquery onscroll sticky header"

0

jquery onscroll sticky header

$(window).scroll(function(){
  var sticky = $('.sticky'),
      scroll = $(window).scrollTop();

  if (scroll >= 100) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
});
Posted by: Guest on May-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language