Trying to click (onClick) an animated gif image of an on/off switch to start a second animation which is located on a different location on the web-page (a 7-frame animation of a generator with moving parts) immediately followed by a random image selection function placing an image in a 3rd location on the page (next to the generator image). The random images are supposed to look like the result of the generator animation---the item that “pops out” of the generator.
We’re thinking that we’re probably missing some code that describes where the 3 different image-spots are on the page (image #1 is the on/off switch gif, image#2 is the generator gif, image#3 is the generator output.png)....or just aren’t coding the string of functions correctly---or maybe our strategy for achieving this is just no correct (?).
Here is the code we have tried that didn’t work. We desperately need a solution quickly and are open to any/other ideas for how to accomplish this. THANKS YOU in advance for your help!!!:
<!-- Hide script from old browsers
generator = new Image
generator_on = new Image
generator.src = "christmas_sweater_generator-offswitch.gif"
generator_on.src = "christmas_sweater_generator_on-offswitch.gif"
// Stop hiding script from older browsers -->
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
var myimages=new Array()
//specify random images below. You can have as many as you wish
<!--//specify corresponding links below
var imagelinks=new Array()
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
<a href="#" onclick="function gif_animation(); function random_imglink();">
<img src="christmas_sweater_GENERATOR_files/christmas_sweater_generator-on-off.gif" width="100" height="200" alt="on-off" /></a>