Posted By

Narayon on 05/23/12


Tagged

jquery preload images


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

liakwee
BrockSamsom


preload images on jquery


 / Published in: jQuery
 

URL: http://stackoverflow.com/questions/9197134/jquery-image-replacement-depending-on-scroll-position-only-works-properly-after

this can run before $(document).ready event, since it doesn't rely on any DOM.

  1. $.each(["img/naboutus.png","img/nwhatwedo.png","img/ntheory.png","img/nportfolio.png","img/nclients.png","img/ncontacts.png"],function(i,url){
  2. var img = new Image();
  3. img.src = url;
  4. });

Report this snippet  

You need to login to post a comment.