plan_B: imagemap wechseln, useMap ( Opera 9 - Problem? )

Beitrag lesen

Hallo,

hier mal ein Problem nebenbei, dass zum Ursprungsthema passt.

habe jetzt bei einem Test mit Opera 9.x festgestellt, dass mein altes Script nicht wie erwartet arbeitet. Mit Opera 8.6 lief es fehlerfrei wie IE oder FF.

den maps zusätzlich zum Namen noch eine id zu geben, hat auch nicht geholfen.

möglicherweise habe ich doch was übersehen, und es ist kein Browserbug.

  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  
        "http://www.w3.org/TR/html4/strict.dtd">  
<html>  
<head>  
<title>test imagemap wechseln</title>  
<script type="text/javascript">  
[code lang=javascript]  
  
function chg_map(inp_ele)  
 {  
 inp_ele.flag = inp_ele.flag ? false:true;  
 var map_name= inp_ele.flag ? "m2":"m1";  
  
 var img=document.getElementById("Bild");  
 bild_info(img,"vor map-Wechsel");  
 img.useMap="#"+map_name;  
 bild_info(img,"nach map-Wechsel zu: "+map_name+  
  "\n\n hier findet mit Opera9 kein Wechsel statt");  
 }  
  
function clk_area(obj)  
 {  
 alert("obj.nodeName: "+obj.nodeName  
 +"\nobj.parentNode.nodeName: "+obj.parentNode.nodeName+" "+obj.parentNode.name  
 +"\n\n title: "+obj.title  
 +"\n shape: "+obj.shape  
 +"\n coords: "+obj.coords );  
  
 return false;  
 }  
  
function bild_info(img_obj,txt)  
 {  
 alert("info: "+txt+"\n"  
 +"\n src: "+img_obj.src  
 +"\n map: "+img_obj.useMap);  
 }  
  

</script>
</head>

<body>
<div style="text-align:center;">

<map name="m1">
<area href="#" shape="circle" alt="" coords="25,25,25" title="links oben" onclick="return clk_area(this)">
<area href="#" shape="circle" alt="" coords="60,50,10" title="Mitte" onclick="return clk_area(this)">
</map>

<map name="m2">
<area href="#" shape="circle" alt="" coords="75,75,25" title="rechts unten" onclick="return clk_area(this)">
</map>

<img id="Bild" src="http://src.selfhtml.org/xweb.gif" alt="web.gif" usemap="#m1">
<p>
<input type="button" onclick="chg_map(this)" value="change_map">
</div>
</body>
</html>
[/code]

danke schon mal ...

Gruß plan_B

--
     *®*´¯`·.¸¸.·