Norbert Klein: Statusänderung bei Imagemaps

Beitrag lesen

<html>
<head>
<script language="JavaScript">
<!--
 window.defaultStatus = "Irgendwas";
 function Stat(x)
  {
   description = x;
   window.setTimeout("window.status = description",1);
  }
//-->
</script>
</head>
<body>

<div style="position:absolute; top:0px; left:0px;">

<img src="Bild.jpg" usemap="#Grafik" border=0>
<map name="Grafik">

<!-- Hier geht der Status -->

<area shape=polygon coords="381,206 403,202 416,189 419,186 423,184 435,163 433,151 437,126 428,104 423,80 404,52 382,44 381,44 378,47 348,74 335,104 321,124 327,141 327,144 324,147 326,165 328,170 331,173 332,178 349,198 377,204" href=Seite.html alt="" target="_top" onMouseover="Stat('Beschreibung')" onMouseout="Stat('')"></area>
</map>
</div>

</body>
</html>

Die Variable "description" wird benötigt, da das Timeout erst nach Funktionsablauf, um genau zu sein 1ms nach Funktionsablauf, beginnt und die Variable "x" nur innerhalb der Funktion Bestand hat.
Des Weiteren ist das onMouseover und onMouseout im body sinnlos, window.defaultStatus ist da besser.

Gruß
Norbert