Pre-Loading Images

Pre-loading images (and in some cases HTML files) speeds up their display by using your browser’s cache. This means quick loading when the files are required.
 
  var preloadImages = function ()
  {     
   for( var i = 0; i < arguments.length; i++ )
   {
       this[ i ] = new Image();
       this[ i ].src = arguments[ i ];      
   }
   return this;
  }
  
  document.body.onload = function()
  {
   preloadImages(‘path2Image’, ‘path2NextImage’);  
  }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s