Tutorial :avoid loading images using javascript


Say I have the following 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.



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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »