jQuery loading images on demand

后端 未结 1 700
一个人的身影
一个人的身影 2021-01-07 04:16

I am trying to load images on demand, in order to prevent downloading of unneeded images. I am using jQuery. So far, this is what I have come up with:

$(\'#         


        
相关标签:
1条回答
  • 2021-01-07 04:40

    There is a good library: JAIL

    Selected images will be downloaded if they are visible and when they are visible inside the viewport (rectangular viewing region). Images can be loaded after an event is triggered (such as click, mouseover, and scroll) or after a specified delay. It's advisable to call jail() after the DOM has been constructed (document ready).

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