Datenschutzerklärung

OnMouseOver Problem

Validome - Forum

Startseite Validome
RSS 2.0  
Sie sind nicht angemeldet. Atom 1.0  
Forum Home / Javascript-Forum /

OnMouseOver Problem

  Beitrag schreiben
Autor
Beitrag Seiten: 1
Minsutoreru
Mitglied

Registriert: 18.05.2008
Beiträge: 1
Hallo!

Ich habe folgendes Problem: Man stelle sich eine Image Map vor, auf der sich mehrere verweissensitive Punkte befinden. Ich habs nun so eingerichtet, daß man beim Drüberfahren mit dem Mauszeiger dieser Punkte mit "onMouseover" rechts neben dem Image Informationen angezeigt bekommt. Doch nun stellt sich das Problem beim überfahren mehrerer Punkte ein, daß sich die Infos überlappen. Ich bräuchte also eine Funktion, die sagt, daß die angezeigten infos wieder versteckt werden sollen, sobald ein neuer punkt überfahren wird.

Hier mal der Code:

Code:

<head>
<script language="JavaScript1.2">      
  function versteckt(id, NNtype, IEtype, WC3type) {
      if (document.getElementById) {
          eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
      } else {
          if (document.layers) {
              document.layers[id].visibility = NNtype;
          } else {
              if (document.all) {
                  eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
              }
          }
      }
  }
  
  
  function popuponclick()
{
 my_window = window.open("",
    "mywindow","status=1,width=250,height=150,left=300,top=300");
my_window.document.write('<H1>Teh Popup Window</H1>');  
}
  
  function closepopup()
{
 if(false == my_window.closed)
 {
    my_window.close ();
 }
 else
 {
    alert('Window already closed!');
 }
}

function ShowHide(id) {
    obj = document.getElementsByTagName("div");
    if (obj[id].style.visibility == 'visible'){
    obj[id].style.visibility = 'hidden';
    }
    else {
    obj[id].style.visibility = 'visible';
    }
}
</script>
</head>


  <body>

      <map name="Weltkarte">
          <area shape="rect" coords="544,322,584,362" href="#" alt="Stadt1" title="Stadt1" onMouseover="versteckt('hometown','show','visible','visible')">
        
        <area shape="rect" coords="620,277,660,317" href="#" alt="Stadt2" title="Stadt2" onMouseover="versteckt('jokercave','show','visible','visible')">
        
        <area shape="rect" coords="610,267,670,327" href="#" alt="Stadt2" title="Stadt2" onMouseover="versteckt('blank','show','visible','visible')">
        
        <area shape="circle" coords="524,77,5" href="http://www.herne.de" alt="Herne" title="Stadt Herne">
          <area shape="circle" coords="933,73,5" href="http://www.castrop-rauxel.de" alt="Casrop-Rauxel" title="Kreis Recklinghausen">
          <area id="bild2" shape="circle" coords="971,307,30" href="http://www.dortmund.de" alt="Dortmund" title="Stadt Dortmund">
          <area id="bild" shape="circle" onMouseover="versteckt('bild','show','visible','visible')" onMouseout="versteckt('bild','hidden','hidden','hidden')" coords="434,438,5" href="http://www.bochum.de" alt="Bochum" title="Stadt Bochum">
          <area shape="circle" coords="78,666,5" href="http://www.essen.de" alt="Essen" title="Stadt Essen">
          <area shape="circle" coords="971,704,5" href="http://www.witten.de" alt="Witten" title="Stadt Witten">
          <area shape="circle" coords="451,970,5" href="http://www.hattingen.de" alt="Hattingen" title="Stadt Hattingen">
      </map>
    
      
      <p><img src="bof2.png" width="800" height="676" border="0" alt="Weltkarte" usemap="#Weltkarte" style="position:absolute; top:0px; left:0px; z-index:1"></p>
    
<div id="blank" style="visibility:hidden; position:absolute; left:800px; top:200px; z-index:2"><img src="blank.png"></div>

<div id="hometown" style="visibility:hidden; position:absolute; top:300px; left:800px; width:150px; height:150px; z-index:3" align="center">
<img src="hometown.png">
<table border="0"><th><i>blabla</i></th>
<tr>
<td>bla</td></tr>
</table>
</div>

<div id="jokercave" style="visibility:hidden; position:absolute; top:300px; left:800px; width:150px; height:150px; z-index:4" align="center">
<img src="jokercave.png">
<table border="0"><th><i>blabla</i></th>
<tr>
<td>bla</td></tr>
</table>
</div>

</body>
</html>

Nicht wundern, nicht alle Funktionen werden darin derzeit verwendet. Aber um die geht's ja auch nicht. ^^


18.05.2008 02:26:43
  Beitrag schreiben
keks
Gast



Man könnte die Funktion die etwas "ausmacht" mit onMouseout aufrufen.

18.05.2008 13:08:26
  Beitrag schreiben
Seiten: 1   Beitrag schreiben
Wechsel zu

Die letzten Beiträge aus diesen Forum

Valid HTML 4.01