Posted By

primitiveshaun on 04/15/11


Tagged

basics


Versions (?)

Preload Images


 / Published in: JavaScript
 

Preloads defined images to the browser cache

  1. <!--
  2. if (document.images)
  3. {
  4. pic1= new Image(100,25);
  5. pic1.src="http://someplace.com/image1.gif";
  6.  
  7. pic2= new Image(240,55);
  8. pic2.src="http://someplace.com/image2.gif";
  9.  
  10. pic3= new Image(88,31);
  11. pic3.src="http://someplace.com/image3.gif";
  12. }
  13. //-->

Report this snippet  

You need to login to post a comment.