frusti
asked on
Dynamic Usemap with Javascript
I have a very large Image and have direction-buttons to navigate over them (with arrays). To change the Image is no problem, but how can I change the map? I have just make the HTML-Side with document.write, but now, I become an error when I`m clicking on one direction-button (JavaScript Error: incorrect number of arguments). Have any an idee? Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<SCRIPT>
/* The array below can be made 1.0 compatible if needed */
theMaps = new Array()
theMaps[0] = new Array('page1.html',null,nu
theMaps[1] = new Array(null,'page2.html',nu
theMaps[2] = new Array(null,null,'page3.htm
CurrentMap = 0;
function goThere(idx) {
theHref = theMaps[CurrentMap][idx];
if (theHref != null) location = theHref;
}
fucntion myVoid() { ; } // nothing
</SCRIPT>
<A HREF="javascript:myVoid()"
<A HREF="javascript:myVoid()"
<A HREF="javascript:myVoid()"
<MAP>
<AREA.... HREF="javascript:goThere(0
<AREA.... HREF="javascript:goThere(1
<AREA.... HREF="javascript:goThere(2
</MAP>
So the click in the href will change the links in the map.
Hope I made myself clear,
Michel