Preload Images jQuery


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



Copy this code and paste it in your HTML
  1. /* Image Preloader Start*/
  2. function preload(arrayOfImages) {
  3. $j(arrayOfImages).each(function(){
  4. $j('<img/>')[0].src = this;
  5. });
  6. }
  7. preload([
  8. 'skin/frontend/default/anandamaya/images/menu_bg1.png',
  9. 'skin/frontend/default/anandamaya/images/menu_bg2.png',
  10. 'skin/frontend/default/anandamaya/images/menu_bg3.png',
  11. 'skin/frontend/default/anandamaya/images/menu_bg4.png',
  12. 'skin/frontend/default/anandamaya/images/menu_bg5.png',
  13. 'skin/frontend/default/anandamaya/images/menu_bg6.png',
  14. 'skin/frontend/default/anandamaya/images/menu_bg7.png',
  15. 'skin/frontend/default/anandamaya/images/menu_bg8.png',
  16. 'skin/frontend/default/anandamaya/images/menu_bg9.png',
  17. 'skin/frontend/default/anandamaya/images/menu_bg10.png',
  18. 'skin/frontend/default/anandamaya/images/menu_bg11.png'
  19. ]);
  20. /* Image Preloader End*/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.