Linktext
[Beschreibung]
Eine weitere Variante der Tooltips...
[Kompatibilität]
[Code]
<style type="text/css"> <!-- .tooltiptitle{COLOR: #00CC00; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-weight: bold; font-size: 9pt} .tooltipcontent{COLOR: #00CC00; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-size: 9pt} #ToolTip{position:absolute; width: 100px; top: 0px; left: 0px; z-index:4; visibility:hidden;} --> </style>
<script language = "javascript"> <!-- //Browser Sniffer var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var mozup = (!document.all && document.getElementById) ? 1 : 0; if (ns4up) { doc = "document."; sty = "" } if (ie4up) { doc = "document.all."; sty = ".style" } if (mozup) { doc = "document.getElementById"; sty= ".style"; } var initialize = 0 var Ex, Ey, topColor, subColor, ContentInfo if (ie4up) { Ex = "event.x" Ey = "event.y" topColor = "#003366" subColor = "#333300" } if (ns4up) { Ex = "e.pageX" Ey = "e.pageY" window.captureEvents(Event.MOUSEMOVE) window.onmousemove=overhere topColor = "#556677" subColor = "#778899" } if (mozup) { Ex = "e.pageX" Ey = "e.pageY" window.document.onmousemove=overhere topColor = "#003366" subColor = "#333300" } function MoveToolTip(layerName, FromTop, FromLeft, e) { if (ie4up) { eval(doc + layerName + sty + ".top = " + (eval(FromTop) + document.body.scrollTop)) eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15)) } if (ns4up) { eval(doc + layerName + sty + ".top = " + eval(FromTop)) eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15)) } if (mozup) { eval(doc + '("'+ layerName +'")'+ sty + '.top = ' + eval(FromTop)) eval(doc + '("'+ layerName +'")'+ sty + '.left = ' + (eval(FromLeft) + 15)) } } function ReplaceContent(layerName) { if (ie4up) { document.all[layerName].innerHTML = ContentInfo } if (ns4up) { with(document.layers[layerName].document) { open(); write(ContentInfo); close(); } } if (mozup) { document.getElementById(layerName).innerHTML = ContentInfo } } function Activate() { initialize=1 } function deActivate() { initialize=0 } function overhere(e) { if(initialize) { MoveToolTip("ToolTip", Ey, Ex, e) if (mozup) { document.getElementById("ToolTip").style.visibility = "visible"; } else { eval(doc + "ToolTip" + sty + ".visibility = 'visible'") } } else { MoveToolTip("ToolTip", 0, 0) if (mozup) { document.getElementById("ToolTip").style.visibility = "hidden"; } else { eval(doc + "ToolTip" + sty + ".visibility = 'hidden'") } } } function EnterContent(layerName, TTitle, TContent) { ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+ '<tr><td width="100%" bgcolor="#000000">'+ '<table border="0" width="100%" cellspacing="1" cellpadding="0">'+ '<tr><td width="100%" bgcolor='+topColor+'>'+ '<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+ '<tr><td width="100%">'+ '<font class="tooltiptitle"> '+TTitle+'</font>'+ '</td></tr>'+ '</table>'+ '</td></tr>'+ '<tr><td width="100%" bgcolor='+subColor+'>'+ '<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+ '<tr><td width="100%">'+ '<font class="tooltipcontent">'+TContent+'</font>'+ '</td></tr>'+ '</table>'+ '</td></tr>'+ '</table>'+ '</td></tr>'+ '</table>'; ReplaceContent(layerName) } //--> </script>
onmousemove="overhere()"
<div id="ToolTip"></div>
?? modified by N8i (www.nightfire.ch)
Kopieren Sie bitte den Code