【发布时间】:2014-08-11 20:17:08
【问题描述】:
当用户滚动到 div 时,我如何运行 onclick 函数。尝试设置自动加载的无限滚动,而不是用户单击此按钮。
元素在另一个 div 中水平滚动。
<div id="bottom_end" class="next">
<a onclick="load_more('/orderby/rising/page/12', '12', 'app_index')"></a>
<p>Load more<br>in scroll</p>
</div>
【问题讨论】:
-
[看看这个问题,这对你有帮助][1] [1]:stackoverflow.com/questions/1225102/…
-
@MaulikAnand 注意:您需要为links in comments 使用
[text](url)格式。 -
@MaulikAnand 谢谢你,但是,我应该更清楚“可见”。我的意思是当用户滚动到它时它在视口中时
-
@MattEllwood 为此,How to tell if a DOM element is visible in the current viewport?(阅读前 2 个答案。)另外,jquery trigger function when element is in viewport。
标签: javascript jquery scroll infinite