当用户向下滚动到页面末尾时,我试图将数据附加到 html 表中,这是我能够做到的。但是我如何保持向下滚动的计数?在每个实例中,我都需要将计数加一,每次我的 url 都会附加该计数.. 当计数达到 6 时,我应该停止将计数附加到 url.. 请分享一些关于如何解决这个问题的想法...
test file已添加到此处...
最佳答案
var count = 1;
jQuery("#scrollPane").scroll(function() {
if (Math.ceil(boxHeight - $inner.offset().top + boxOffsetTop) >= innerOuterHeight ) {
if(count==6)
{
alert("stop");
}
count++;
}
});
关于jquery - 如何获取Scroll事件并统计scroll事件的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5659272/