[英]jquery scroll load more don't working
我正在尝试在滚动触摸屏底部加载更多数据,但是在任何页面中均不起作用...
$(window).scroll(function () {
if ($(document).height() <= $(window).scrollTop() + $(window).height()) {
alert("End Of The Page");
}
});
我不知道为什么,因为如果我只做测试:
alert("End Of The Page");
$("#test").html('test');
jQuery和javascript正在工作/正在加载...
您的代码对我来说很好。 可能是您在更换警报时搞砸了。 如果代码仍然不起作用,请按F12键并查看控制台中列出的错误。
这是您提供的确切代码
$(window).scroll(function() {
if ($(document).height() <= $(window).scrollTop() + $(window).height()) {
$("#test").html('test');
}
});
小提琴: https://jsfiddle.net/3dvro7wy/1/
: https://jsfiddle.net/3dvro7wy/1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.