Closed Thread Icon

Topic awaiting preservation: Preloading / Rollover JS Wrapper (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8374" title="Pages that link to Topic awaiting preservation: Preloading / Rollover JS Wrapper (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Preloading / Rollover JS Wrapper <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 11-02-2002 19:16

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).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-02-2002 19:22

Karl: This has been dealt with before (a lot):
http://faq.ozoneasylum.com/753/

___________________
Emps

FAQs: Emperor

« BackwardsOnwards »

Show Forum Drop Down Menu