Posted By


fackz on 12/01/09

Tagged


Statistics


Viewed 781 times
Favorited by 2 user(s)

image preloader


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



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. function preload() {
  3. if (document.images)
  4. {
  5. preload_image_object = new Array();
  6. image_url = new Array();
  7. image_url[0] = "images/Homepage/HomepageSquare_2.jpg";
  8. image_url[1] = "images/Homepage/HomepageSquare_3.jpg";
  9. image_url[2] = "images/Homepage/HomepageSquare_4.jpg";
  10. image_url[3] = "images/Homepage/HomepageSquare_5.jpg";
  11. image_url[4] = "images/Homepage/HomepageSquare_6.jpg";
  12. image_url[5] = "images/Homepage/HomepageSquare_7.jpg";
  13. image_url[6] = "images/Homepage/HomepageSquare_8.jpg";
  14. image_url[7] = "images/Homepage/HomepageSquare_9.jpg";
  15. image_url[8] = "images/Homepage/HomepageSquare_10.jpg";
  16.  
  17. for(var i=0, limit = image_url; i<limit; i++)
  18. {
  19. preload_image_object[i]=new Image();
  20. preload_image_object[i].src = image_url[i];
  21. }
  22. }
  23. }
  24. </script>
  25.  
  26.  
  27. <body onload="javascript:preload();">

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.