Click to See Complete Forum and Search --> : mouse hover question


addie
10-29-2003, 07:28 AM
hi in my site i have dhtml script that on mouse hover change buttons, but buttons on hover are loading very slow even images are 2kb also my hosting is very fast, is there any trick that order all images load on page load ?

pyro
10-29-2003, 07:46 AM
Try doing a seach for "preload images" in the JavaScript section of these forums, or on google.

gil davis
10-29-2003, 07:50 AM
Yes, it is called "preloading images". You can search the JavaScriptSource and find a script. Basically it is something like this:
var imgnames = new Array("img1.gif", "img2.gif"); // put your names in this array
var imgs = new Array();
for (var i in imgnames) {
imgs[i] = new Image();
imgs[i].src = imgnames[i].src; // this reads the file into cache
}

Use only the names of images that are not already somewhere in the HTML source.

addie
10-29-2003, 08:52 AM
thanks alot guys thats what i wanted :)