[英]load AJAX page when scrollbar is 200px far from bottom of the window where window size may vary
I have tried this condition so far. 到目前为止,我已经尝试过这种情况。
'if ($(window).scrollTop() == $(document).height() - $(window).height())'
so can anybody help me to get the solutuion .??? 所以有人可以帮助我获得解决方案吗???
Try this: 尝试这个:
$(function () {
$(window).on('scroll', function () {
if ($(window).scrollTop() + $(window).height() >= $(document).height() - 200) {
//initate ajax here
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.