开发者

avoid loading images using javascript

Say I have the followi开发者_如何学JAVAng code in my html:

<html>
  <....> 
   <img src="the-image.gif" />
  <....>
</html>

Is it possible to avoid loading the image using javascript? I want to load it later, using javascript. But I don't want it to be loaded automatically.

I am trying to delay the request of the image.

Thanks


You can use the LazyLoad jQuery Plugin.

Lazy loader is a jQuery plugin written in JavaScript. It delays loading of images in (long) web pages. Images outside of viewport (visible part of web page) wont be loaded before user scrolls to them. This is opposite of image preloading.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜