我正在使用phonegap开发一个应用程序,除了滚动检测之外一切正常!它工作正常,直到我使用 jQueryMobile 数据转换移动到另一个页面,之后它根本不起作用,尽管其他一切都工作正常!
这是我用于滚动检测的代码
// to check if I reached the bottom of the slide
if($(window).scrollTop() + $(window).height() == $(document).height()) {
// my code goes here
}
// to check if I'm at the top of the slide
if(document.body.scrollTop == 0 ) {
// my code goes here
}
最佳答案
我找到了一个解决方案,我所做的就是按照这个方法来检测滚动,它工作得很好!
https://jqmtricks.wordpress.com/2014/07/15/infinite-scrolling/
特别感谢 jQMtricks 管理员 Omar 提供的这种出色的检测方法
关于javascript - 调用新页面Javascript后滚动检测不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28658927/