preload images on jquery


/ Published in: jQuery
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. });

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.