Click to See Complete Forum and Search --> : onmouseover... dual image change


richard
12-16-2002, 08:55 PM
I am looking for a script that when the cursor passes over part of an image that part would change and a second image would change also.
For example say the image was of a traffic light if I placed my cursor over the top circle then that circle would turn red (from say black) and a another part of the image say a “walk/don’t walk” sign would change also.

Can someone please help me find this script???

Thanx in advance
Richard

Beach Bum
12-16-2002, 09:05 PM
you can put as many changes as you want in the script. to change an image you use (for eaxmple):

function changeIt() {
document.name1.src='xxx2.gif';
document.name2.src='xxx2.gif';
}

so onmouseover you run the function.

the two images you want to change would have name attributes of name="name1" and name="name2" in my example.

richard
12-17-2002, 07:18 PM
Thanx for the help there Beach Bum!!

Being very new to this exercise I wonder if you know of a more complete code example.........

Have you seen it in action on a website or do you think you could send me a little more info....... any help would be appreciated.......

Richard

Beach Bum
12-18-2002, 06:18 PM
you need something like this for the mouseover image:

<img src="1.gif"
onmouseover="javascript:changeIt()"
width="65" height="65">

so that when you mouseover the image you execute the javascript in the prior post to change the two other images (or you can change the same image if you want). Each of the images you want to change needs a name attribute (as also discussed above) like this:

<img src="2.gif" width="65" height="65" name="name1">

Hope this helps.