Is there a way to apply a specific class to $ ('# header') once my webpage has been scrolled down by 100 pixels?
Take a look at this code snippet:
$(window).scroll(function(){
var offset = $(window).offset();
if (offset.top > 100) {
$('#header').addClass('header2')
}
else {
$('#header').removeClass('header2')
};
});
#JQueryCode