forxtu
9/6/2017 - 1:00 PM

Event on scroll to the specific element

Event on scroll to the specific element

$(document).ready(function(){
  var specificElement = $('.products').offset().top;
    $(window).scroll(function() {
        if($(window).scrollTop() > specificElement) {
            $('header').addClass('nav-up');
        }
        else{
            $('header').removeClass('nav-up');
        }
    });
});