Hello,
I'm not a great JS programmer, but getting better. I'd like to create a JS function that would allow me to preload any amount of images in the body onload event by passing a comma seperated list of image names. Then what I would like is another function that would handle the rollovers for these preloaded images. I'd like these 2 functions to work for 2 images or 100+ images (would never do this but...).
Then, for any particular image involved with the rollover event, I'd like the rollover function to find the appropriate image to rollover using some type of naming convention, like:
image name: bluebutton.gif
rollover name: bluebutton_over.gif
In my body onload event I would have done the following:
<body onload=PreLoad('/images/bluebutton.gif,/images/bluebutton_over.gif')>
My image tag then would look something like this:
<img src="/images/bluebutton.gif" onmouseover="swapImage();">
I can handle the basic swap of images, but do not know how to loop through a comma seperated list of images to preload into an array.
Also, don't know how to append "_over" to a text string before ".gif".
Maybe this function has all ready been created?
Thanks for the help!
Karl
[edit] fixed comma seperation in body onload
karl@laketahoegymnasticscamp.com
[This message has been edited by Karl (edited 11-02-2002).]