Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Div verstecken

Empfohlene Antworten

Veröffentlicht

Kann mir einer sagen , was an folgendem Code falsch ist?

Ich steig da nicht durch!

Getestet habe ich den Code mit Netscape 7.1 und IE 6.0

Es funktioniert bei beiden nicht.

Wichtig ist mir eine Lösung, welche für alle Browser funktioniert.



<html>

  <head>


<script language="JavaScript">

<!--


function Over(ID) {

 document.getElementById[ID].style.visibility = "visible"

}


function Out(ID) {

 if(document.getElementById) {

  document.getElementById[ID].style.visibility = "hidden"

 }

}


//-->

</script>


<style type="text/css">

<!--

#karte

{ position:relative; width:768; height:471; z-index:1;}

#plan

{ position:absolute;z-index:5;}


#Aaa

{ position:absolute; left:320px; top:21px; width:169; height:158; z-index:3; }

-->

</style>


</head>

<body onLoad="" onUnload="">


 <map name="Stadtplan" id="plan">

  <area title="" href="#" shape="polygon" coords="334, 72, 361, 45, 387, 62, 421, 37, 422, 26, 437, 27, 440, 21, 455, 22, 447, 36, 487, 54, 484, 74, 472, 78, 472, 87, 462, 88, 468, 111, 438, 129, 438, 151, 444, 151, 446, 162, 453, 165, 453, 170, 420, 176, 395, 174, 381, 163, 371, 163, 357, 146, 323, 124, 342, 111, 345, 96"  onMouseOver="Over('Aaa');" onMouseOut="Out('Aaa');">

 </map>


<div id="plan"><img src="pics/trans.gif" width="768" height="471" border="0" alt="" usemap="#Stadtplan"></DIV>

<div id="karte">

<img src="pics/stadtplan3.gif" width="768" height="471" border="0" alt="">

     <div id="Aaa"><img src="pics/a.gif" width="169" height="158" border="0" alt=""></div>


</div>



 </body>

</html>

Der Code ist schon auf eine Minimum gekürzt!

kann es sein dass es nicht geht, da es ein <div> in einem <div> ist ??? also "Aaa" ist ja in "karte" verschachtelt...

  • Autor

Hat jemand einen Vorschlag wie ich das realisieren könnte!

Sitz momentan auf'm Schlauch!

Sinn soll sein:

Ich habe einen Stadtplan als Bild

Ich habe mehrere Stadtteile als Bilder in anderer Farbe

wenn der User nun über den Stadtteil fährt soll das Bild gewechselt werden

Mir fällt nicht ein, wie ich das machen soll!

Ändere doch einfach das Bild für die Map.

Wichtig ist dabei nur, dass alle Bilder die gleiche Größe und den gleichen Maßstab haben.

BSP:


// JavaScript
function highlight(name) {
document.BildName.src = "pics/highlight_"+name+".jpg";
}

function normalize() {
document.BildName.src = "pics/default.jpg";
}

// HTML
<img id="BildName" ... > </img>
// Den Rest wie gehabt.
[/PHP]

Da das Ganze ein einfacher Bildtausch ist, sollte es auch keine browserspezifischen Probleme geben.

hier brauchst du runde Klammern!


<script language="JavaScript">

<!--


function Over(ID) {

 document.getElementById(ID).style.visibility = "visible" // hier () anstatt []

}


function Out(ID) {

 if(document.getElementById) {

  document.getElementById(ID).style.visibility = "hidden" // hier () anstatt []


 }

}


//-->

</script>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.