PDA

View Full Version : Time crunch - need help - mouseover calling 2 items



crash41
03-18-2009, 04:33 PM
I would like a mouseover to force and image swap - and also change the image map that's being used.

So i would like to combine something like this:

the image swap code:
onMouseOver="document.getElementById('mainlink').href=

with something like this - the usemap code:
onMouseOver="document.mainlink.setAttribute('usemap','#Map2',0)

How do i combine those into one? Or can i/should i?

Thanks!

jlizarraga
03-18-2009, 06:27 PM
The pieces of code you have between the double quotes ( " " ) are called statements.

By ending the statements with a semicolon, you can have more than one in there. To use your code:

onMouseOver="document.getElementById('mainlink').href=[new href here];document.getElementById('mainlink').setAttribute('usemap','#Map2',0);"