![](/img/trans.png)
[英]<select> drop down flashing on focus in iphone browser with iScroll4 script
[英]iScroll4 swipe down and up events
我已经编写了如下代码,但是当我始终滚动时, onScrollEnd
被触发。 如何检测用户是向下滚动还是向上滚动?
myScroll = new iScroll('SaleListingContainer', { desktopCompatibility: true, useTransition: true,
// topOffset: pullDownOffset,
onRefresh: function() {
alert("refresh");
},
onScrollMove: function() {
alert("move");
},
onScrollEnd: function() {
alert("end");
}
});
感谢您的宝贵时间和提前的帮助。 非常感谢。
使用dirY
属性,如果用户向下滚动,则为1;如果用户向上滚动,则为-1:
onScrollEnd: function() {
if (this.dirY == 1) { alert('scrolling down'); }
else if (this.dirY == -1) { alert('scrolling up'); }
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.