Closed Thread Icon

Topic awaiting preservation: onMouseOver w/random img (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=8172" title="Pages that link to Topic awaiting preservation: onMouseOver w/random img (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: onMouseOver w/random img <span class="small">(Page 1 of 1)</span>\

 
Dark
Neurotic (0) Inmate
Newly admitted
posted posted 05-17-2002 20:34

This script that will randomly display an image out of four images.
How do I go about adding a onMouseover to each image?

Like onMouseOver="window.status='My message'; return true"

<script language="JavaScript">
<!--
function random_imglink(){
var Jon=new Array()
Jon[1]="http://jonkriek.com/Gallery/Banner_Music.jpg"
Jon[2]="http://jonkriek.com/Gallery/Banner_Music2.jpg"
Jon[3]="http://jonkriek.com/Gallery/Banner_Music3.jpg"
Jon[4]="http://jonkriek.com/Gallery/Banner_Music4.jpg"
var Krieklinks=new Array()
Krieklinks[1]="Harmony.html"
Krieklinks[2]="Harmony.html"
Krieklinks[3]="Harmony.html"
Krieklinks[4]="Harmony.html"
var ry=Math.floor(Math.random()*Jon.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+Krieklinks[ry]+'"'+'><img src="'+Jon[ry]+'" border=0></a>')
}
random_imglink()
//-->
</script>


Dark

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-17-2002 21:26

Well, you'd need to add another array for the mouseover images. Then code the mouseover just as you would for a single image, but make it dependant on the image number. Make some sort of function that switches the image with a given new image, and make sure you pass it some variable telling it what image to replace itself with.

Dark
Neurotic (0) Inmate
Newly admitted
posted posted 05-17-2002 21:59

haha, ok.
That's easier said than done.
Thanks for your input =)

Dark

[This message has been edited by Dark (edited 05-17-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu