How can I get jQuery to call an event handler when an image actually appears on-screen?

后端 未结 2 1333
耶瑟儿~
耶瑟儿~ 2021-01-18 18:31

How can I use jQuery to trigger a callback of a JavaScript function when I scroll down and see a picture? I wish to delay loading certain images until they actually appear o

相关标签:
2条回答
  • 2021-01-18 19:05

    I think this JQuery Event Plugin does what you need:

    Element 'in view' Event Plugin

    I've created an event that will trigger when the element is scrolled in to the viewport.

    also, the LazyLoad Plugin seems to have a "viewport" selector for JQuqery: Here.

    0 讨论(0)
  • 2021-01-18 19:12

    Here is some kind like what i searched for... http://www.appelsiini.net/projects/lazyload

    0 讨论(0)
提交回复
热议问题