任何人都可以使用这个JavaScript来帮助我吗?jQuery .scrollTop混淆
我想div
显示,当你超过1000个像素向下滚动,目前它与下面的脚本,但滚动时,它立即显示。
我试着将它设置为>1000
,并没有显示在所有?
任何想法?
$(window).scroll(function(){
/* Check the location of each desired element */
$('.hideme').each(function(i){
/* If the object is completely visible in the window, fade it in */
if ($(this).scrollTop() < 1000){
$(this).animate({'opacity':'1'},900);
}
});
});
ü可以包括你的CSS与它一起请。 –