Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript on scroll change nav color

$(function () {
  $(document).scroll(function () {
    var $nav = $(".navbar-fixed-top");
    $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
  });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #scroll #change #nav #color
ADD COMMENT
Topic
Name
9+3 =