3
This script controls the existence of the class hide-bar
in id header
page loading when the class is not yet added to it. I need to find a solution so that once the class is added to the id which is exactly when there is a scrolling of the page, the script is executed.
jQuery(function($){
$( "#header", function() {
//////////////////////////////////////////////
if ( $("#header").hasClass("hide-bar") ){
alert("A classe está adicionada.");
}
});
});
@Marcosvinicius great! If you want you can also use
$(window).scrollTop()
to know the position of the scroll.– Sergio