I am trying to fire an fadeIn by using scroll & scrollTop when reaching a certain scrollposition.
In case animation stops, when the user stops scrolling. I think its because the scroll function is triggered just during scrolls. Anyone got an idea how to solve this?
- var sPos = 0;
$(window).scroll(function(){
position = $(window).scrollTop();
if(sPos > 2000)
{
$("div.galerie-set:hidden:first").each(function(){
$(this).delay(400).fadeIn("slow");
});
console.log("window relative to docposition: " + sPos + "px");
}
});