1

I am wanting to alert someone but only when the scroll height is between a curtain height.

For instance.

When the person scrolls between 2000 pixels and 2500 pixels

I know how to do greater and smaller but how to do between?

var currentscroll = jQuery(this).scrollTop();

if(currentscroll > 2000){
alert('this');
}

Thanks

4

3 回答 3

2

尝试这个:

var currentscroll = jQuery(this).scrollTop();

if((currentscroll > 2000) && (currentscroll < 2500)){
alert('this');
}
于 2013-04-21T22:19:02.070 回答
1

不就是这样吗:

if(currentscroll > 2000 && currentscroll < 2500){
于 2013-04-21T22:18:24.740 回答
0
if (currentScroll > 2000 && currentScroll < 2500)

?

于 2013-04-21T22:20:22.513 回答