当元素在视口中时jquery触发函数
我想在 jquery.localscroll 到达文档的某个点(div)时触发一个事件。
假设我们从顶部 div 垂直滚动到第三个 div。当它到达那里时,就会触发该操作。
I'd like to trigger an event when jquery.localscroll reaches a certain point of the document, a div.
Lets say we're scrolling vertically from the top div to the third. When it gets there, then the action schould trigger.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
jQuery Waypoints 插件 http://imakewebthings.github.com/jquery-waypoints/ 应该执行以下操作技巧
更新
jQuery Waypoints plugin http://imakewebthings.github.com/jquery-waypoints/ should do the trick
UPDATE
您可能还想看看以下小插件,它过去对我很有帮助,而且非常干净:
用法示例:
You may want to also see the following tiny plugin, it's help me in the past and it's pretty clean:
Example Usage:
jQuery Bullseye: http://static.pixeltango.com/jQuery/Bullseye/ 也有视口检测方面做得很好!
jQuery Bullseye: http://static.pixeltango.com/jQuery/Bullseye/ does also a great job on viewport detection!
https://github.com/stutrek/scrollMonitor
https://github.com/stutrek/scrollMonitor