How to Preload images using Javascript

I had asked for help here in Freeway Talk in figuring out how to do this, as I couldn’t recall how I had done it, oh, say10 years ago. So, after a LOT of URL cruising I found what I was looking for. So here is the info that I found and am sharing it with anyone who needs it.

To preload an image into your web page, paste the code below into the document head (replace the red image file name with your own):

You can add more images by duplicating the image lines, e.g.:

OR:
http://www.yourhtmlsource.com/images/preloading.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Or there’s this:

// in the Protaculous 2 DOM Loaded Observer
$w('image1.jpg image2.png image3.gif image4.png').each(function(img){
	new Element('img', { src: img });
});

Walter

On Dec 3, 2013, at 1:33 PM, gunner holmes wrote:

I had asked for help here in Freeway Talk in figuring out how to do this, as I couldn’t recall how I had done it, oh, say10 years ago. So, after a LOT of URL cruising I found what I was looking for. So here is the info that I found and am sharing it with anyone who needs it.

To preload an image into your web page, paste the code below into the document head (replace the red image file name with your own):

You can add more images by duplicating the image lines, e.g.:

OR:
Pre-Loading Images | loading images early for fast display


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options