jQuery:当div出现时,如何触发事件? [英] jQuery: How can I trigger an event when a div comes into view?
本文介绍了jQuery:当div出现时,如何触发事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当页面滚动足够远以使div可见时,是否可以通过某种方式用jQuery触发事件?
解决方案
我认为您将不得不加入滚动事件并手动进行检查.这是一个类似的问题:
希望有帮助.
鲍勃
Is there some way I can fire an event with jQuery when the page scrolls far enough for a div to come into view?
解决方案
I think you will have to hook into the scroll event and manually check. Here is a similar question:
Check if element is visible after scrolling
Hope that helps.
Bob
这篇关于jQuery:当div出现时,如何触发事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文