Forum Moderators: open
my question is this:
Is it possible to also swap image maps?
e.g. if i had a list of menu items that, when rolled over, swaped an image somewhere else on the page. Imagine that image also had image maps on it. Is it possible that when the new image is loaded that it will also load a new set of image maps?
Regards
Webboy
Since hotspot information is embedded in the HTML page itself, the swap image behavior cannot load a new image map. If it is desired to have JavaScript rollovers with hyperlinks, use a DHTML Show/Hide Layers function so that the image source tag can include the link information in a DHTML layer.
Macromedia reference [macromedia.com]
<HTML>
<HEAD>
<TITLE>A Rollover Imagemap</TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML"><script language="JavaScript">
<!--
//*****************OnClick Function Code
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"><a href="#" OnMouseover="MM_showHideLayers('Layer1','','hide','Layer0','','show')" OnClick="MM_showHideLayers('Layer0','','hide','Layer1','','show')" >Press Here</a>
<div id="Layer0" style="position:absolute; left:300px; top:100px; width:271px; height:301px; z-index:1; visibility: visible "><img src="http://example.com/sp.gif" width="270" height="302" usemap="#Map" border="0" alt="Visit Example" ></div>
<div id="Layer1" style="position:absolute; left:300px; top:100px; width:271px; height:301px; z-index:1; visibility: visible "><img src="http://opotiki.com/nz.gif" width="270" height="302" usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="98,170,243,234" href="http://example.com" target="_blank" alt="Visit Example" title="Visit Example"></map></div>
</BODY>
</HTML>