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. });


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.