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.

Tooltips bei JavaScript

Empfohlene Antworten


<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>

#tool{

 background-color: #ff0;

 width: 150px;

 height: 150px;

 display: none;

}

</style>

<script type="text/javascript">

 function showtool(msg){

  document.getElemenById('tool').innerHTML = msg;

  document.getElemenById('tool').style.display = 'block';

 }


 function hidetool(){

  document.getElemenById('tool').style.display = 'none';

 }

</script>

</head>

<body>

<div id="tool">

</div>

<a href="#" onMouseOver="showtool('text')" onMouseOut="hidetool()">text</a>

</body>

</html>

die funktion kannst du dann überall aufrufen und benutzen. :) ist aber sehr vereinfacht dargestellt.

  • Autor

habs probiert, aber da kommt diese tolle fehlermeldung:

"das objekt unterstützt diese eigenschaft oder methode nicht..."

hast du eine idee, was ich noch falsch haben könnte?

welchen browser setzt du ein?

das script geht nur bei browser ab v5.0

im style könntest auch noch ein position: absolute; einügen aber das sollte nicht der fehler sein.

hab nen IE 5.5 SP2 folgenden code in det .htm datei und bekomme dennoch folgenden fehler:

Zeile: 21

Zeichen: 3

Fehler: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.

Code: 0

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
#tool{
background-color: #ff0;
width: 150px;
height: 150px;
display: none;
position: absolute;
}
</style>
<script type="text/javascript">
function showtool(msg){
document.getElemenById('tool').innerHTML = msg;
document.getElemenById('tool').style.display = 'block';
}

function hidetool(){
document.getElemenById('tool').style.display = 'none';
}
</script>
</head>
<body>
<div id="tool">
</div>
<a href="#" onMouseOver="showtool('text');" onMouseOut="hidetool();">text</a>
</body>
</html>[/PHP]

getElemenById

mal durch

getElementById

ersetzen war ein tippfehler sorry.

und ich sitz auf meinen augen...

getElemenById

mal durch

getElementById

danke, danke!! ich meinte aber,dass ich das auch im script hätte sehen müssen...

cu TinTin

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.