Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

To Change usemap

Posted on 2001-07-24
4
Medium Priority
?
398 Views
Last Modified: 2010-05-18
Hello,

I've an image with sevarals mapping. But I don't know how to change usemap in the img tag.
My code :

<html>
<head>
<script language=JavaScript>
function ChangeMap()
{
document.plan.usemap='#1ET';
}
</script>
</head>
<body>
<img src="images/Bouguenais1.gif" name="plan" border=0 usemap="#RDC">
<br>
<a href="Javascript:ChangeMap()">Change Map</a>
<map name="RDC">
  <area shape="rect" coords="402,277,452,352" href="#">
  <area shape="rect" coords="454,279,488,351" href="#">
</map>
<map name="1ET">
  <area shape="poly" coords="489,278,520,280,549,318,535,338,532,333,517,332,517,351,489,351" href="#">
  <area shape="poly" coords="522,278,543,248,573,283,550,316" href="#">
</map>
</body>
</html>

To put '#1ET' in usemap property doesn't work.
Why ???
0
Comment
Question by:fabriceb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:shlomof
ID: 6311369
document.plan.src='#1ET';
0
 
LVL 4

Accepted Solution

by:
ravi_raj123 earned 400 total points
ID: 6311383
<html>
<head>
<script language="javascript">
function changemap(){
document.frm.plan.useMap="#Map1";
}
</script>
</head>
<body>
<form name="frm">
<map name="Map0">
 <area shape="rect" coords="402,277,452,352" href="#">
 <area shape="rect" coords="454,279,488,351" href="#">
</map>

<map name="Map1">
<area shape="poly" coords="489,278,520,280,549,318,535,338,532,333,517,332,517,351,489,351" href="#">
 <area shape="poly" coords="522,278,543,248,573,283,550,316" href="#">
</map>

<img name="plan" border="0" src="map.jpg" usemap="#Map0">
<a href="javascript: changemap()">Change Map</a>
</form>
</body>
</html>


GOOD LUCK...:)
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7152087
________________________________________
do not accept this comment as the answer

this question has been abandoned. experts please
post recommendations below to help the moderators.



________________________________________
my recommendation
points to ravi_raj123
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7181513
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question