无限滚动不会触发页面底部之前的点击

时间:2021-01-20 02:39:13

标签: jquery window infinite-scroll scrolltop

我想在点击页面底部(如 200px 以上)之前点击无限滚动。当我使用它时,我设法达到了底部并且一切正常。

    if ($(window).scrollTop() + $(window).height() == $(document).height()) {
         console.log('Thanks a lot');
     }

但是这些代码没有按我的预期工作

   if ($(window).scrollTop() + $(window).height() == ($(document).height()-200)) {
         console.log('Thanks a lot');
     }

因为 scrollTop 是连续的数字,它应该可以完美地工作。不知道这里发生了什么。

0 个答案:

没有答案