need help on image map

need help on image map

Post by Yaqia » Sun, 17 Apr 2005 20:06:04

Hello, I want to highlight the clicked area on an image by placing another image
on it. But it replaced the whole image, not the clicked area. My code is as
following, can anyone please help me? Thank you!!!!

<head>
<script language="JavaScript" type="text/javascript">
function changeImagemap(newImage) {
if (js > 1.0) document ['plan'].src = eval(newImage + ".src");
}
</script>
<MAP NAME="MyMap">
<AREA SHAPE="rect" COORDS="216,358,237,378" alt="West Right 5"
onClick="changeImagemap('selected');self.status='selected';return true" >
<AREA SHAPE="rect" COORDS="216,378,237,398" alt="West Right 4">
<AREA SHAPE="rect" COORDS="216,399,237,419" alt="West Right 3">
<AREA SHAPE="rect" COORDS="216,419,237,439" alt="West Right 2">
<AREA SHAPE="rect" COORDS="216,439,237,459" alt="West Right 1">
<AREA SHAPE="rect" COORDS="270,491,291,511" alt="South Left 1">
<AREA SHAPE="rect" COORDS="289,494,310,514" alt="South Left 2">
<AREA SHAPE="rect" COORDS="310,495,331,515" alt="South Left 3">
<AREA SHAPE="rect" COORDS="330,495,351,515" alt="South Left 4">
<AREA SHAPE="rect" COORDS="349,494,371,515" alt="South Left 5">
<AREA SHAPE="rect" COORDS="369,495,390,515" alt="South Left 6">
<AREA SHAPE="rect" COORDS="390,495,411,515" alt="South Left 7">
</MAP>
</head>

<body>
<p>img name="plan" USEMAP="#MyMap" ismap border="0" src="Plan.jpg" width="837"
height="694"></p>

 
 
 

need help on image map

Post by Jay » Mon, 18 Apr 2005 19:30:58


It replaced one image because you only have one image.
You cannot disect an image - on the fly - with a browser.

Jay

 
 
 

need help on image map

Post by PDanny » Tue, 19 Apr 2005 03:29:50


Try making the image map from a completely transparent image (GIF), layer
under it the actual image you want to use then slide in the higlighting
image between the two layers.

Would that work? I haven't tried it myself.