$(window).scroll(function () { // add 'sticky-header' class to the body tag when the header top is scrolled out of view $('body').toggleClass('sticky-header', $(this).scrollTop() > $('.header-top').height()); });
$(window).scroll(function () { // add 'sticky-header' class to the body tag when the header top is scrolled out of view $('body').toggleClass('sticky-header', $(this).scrollTop() > $('.header-top').height()); });