Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery onscroll sticky header

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

  if (scroll >= 100) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #onscroll #sticky #header
ADD COMMENT
Topic
Name
3+4 =