Image Preloading Script
Blogged in Programming, Web Design, Internet by Matt on Thursday December 1, 2005In my previous post regarding CSS Image Rollovers there was question asked whether or not the image is preloaded or not. The image is not preloaded, so on the first visit to the page the image will have to load, causing a brief blank spot to be where the button is. To resolve this we simply need to use a JavaScript based Image Preloading Script which can be found below.
var imageload=new Array()
function preload(){
for (i=0;i
imageload[i]=new Image()
imageload[i].src=arguments[i]
}
}preload(”http://www.name.com/name.jpg”,”http://www.name.com/name2.jpg”, “http://www.name.com/name3.jpg”)
When you use the above script, be sure to change the location of the images in the above URLs to reflect where your images are located.
Popularity: 10% [?]
One Response to “Image Preloading Script”
February 12th, 2006 at 7:49 pm Quote
Eh, don’t do that. It’s very 1998.
Instead:
http://wellstyled.com/css-nopreload-rollovers.html
and
http://www.alistapart.com/articles/slidingdoors2/
Leave a Reply