Hi!
I'm a newbie to Javascript and I'm hoping someone here can help me with my programming problem!
I have an html file that contains an IMG tag that has a "USEMAP" argument. I would like to be able to use a variable for the USEMAP. Here's an example:
I have two maps:
<map name=map1>
<area ....>
<area ....>
</map>
<map name=map2>
<area ....>
<area ....>
</map>
Later in the html I have this img tag
<img src="filename.jpg" name="image" usemap="<here is where I'd like to use a variable">
Still later in the html
<a href="file.html" onMouseover="document.images['image'].src='newimage1.jpg'; return true;">Link 1</a>
<a href="file2.html"
onMouseover="document.images['image'].src='newimage2.jpg'; return true;">Link 2</a>
So that when the user puts his/her mouse over "Link1," the image formerly known as 'filename.jpg' is replaced by 'newimage1.jpg' and would use map named 'map1'.
If the user then places the mouse over "Link2," the image would change and a new map would be used.
I'm stumped!! Any and all help that you can provide would be GREATLY appreciated!!!
Thanks!
Kay
I'm a newbie to Javascript and I'm hoping someone here can help me with my programming problem!
I have an html file that contains an IMG tag that has a "USEMAP" argument. I would like to be able to use a variable for the USEMAP. Here's an example:
I have two maps:
<map name=map1>
<area ....>
<area ....>
</map>
<map name=map2>
<area ....>
<area ....>
</map>
Later in the html I have this img tag
<img src="filename.jpg" name="image" usemap="<here is where I'd like to use a variable">
Still later in the html
<a href="file.html" onMouseover="document.images['image'].src='newimage1.jpg'; return true;">Link 1</a>
<a href="file2.html"
onMouseover="document.images['image'].src='newimage2.jpg'; return true;">Link 2</a>
So that when the user puts his/her mouse over "Link1," the image formerly known as 'filename.jpg' is replaced by 'newimage1.jpg' and would use map named 'map1'.
If the user then places the mouse over "Link2," the image would change and a new map would be used.
I'm stumped!! Any and all help that you can provide would be GREATLY appreciated!!!
Thanks!
Kay