Safak: Tooltips setzen

Beitrag lesen

Hallo,

danke für eure Hilfe und sorry wegen den Threads. Ich hatte die erste Antwort und somit Hilfe nicht verstanden...

Hier ist die Tabelle. Bitte kopiert euch mal den Quelltext und versucht es im IE 5.5 . In der Tabelle sind die linken Zellen ausgefüllt. Die ersten zwei Zellen besitzen einen Tooltip, den ich manuell hineingeschrieben habe. Also das ist nichts besonderes. Da ich es nicht immer so machen will (Zeitaufwändig) habe ich ein Script geschrieben. Dieser Script soll für die nachfolgenden zwei Zellen(und wenn die tabelle größer wird auch alle anderen zellen) die richtigen Tooltips setzen. Nun hier ist das korrigierte Script + die Tabelle. Es funktioniert nicht. Wieso funktioniert das nicht?? Sind Schlauis da die das verstehen? ;) Danke schonmal für die Hilfe! Viele Grüße,

Safak

Der quellcode:

<html>

<head> <title>Tabelle</title>

<meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <base target="_blank"> <meta name="Microsoft Border" content="none">

<script language="JavaScript" type="text/javascript">  <!--  st = "a";  kfi = "b";  cl = "c";  gl = "d";  fo = "e";  cd = "f";

var Tabelle=document.getElementsByTagName("table")[2];  var zelle;

function read(tabelle,zeile,spalte) {   return document.getElementsByTagName("table")[tabelle].getElementsByTagName("tr")[zeile].getElementsByTagName("td")[spalte].firstChild.data; }

function tooltip() {     for (var i=0; i<50; i++) {      for (var j=0; j<10; j++) {       zelle = read(2, i, j);         if (zelle=="ST") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = st;          else if (zelle=="KFI") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = kfi;           else if (zelle=="CL") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = cl;            else if (zelle=="GL") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = gl;             else if (zelle=="FO") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = fo;              else if (zelle=="CD") Tabelle.getElementsByTagName("tr")[i].getElementsByTagName("td")[j].title = cd;               else return;       }      } }

// --> </script>

</head>

<body style="word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0">

<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">  </p>

<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0" align="center"> </p> <table border="0" width="368" cellpadding="0" cellspacing="0">   <tr>     <td align="left" width="12"></td>     <td title="a" align="left" width="25"><font face="Arial" size="2">ST</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">a</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td title="b" align="left" width="25"><font face="Arial" size="2">KFI</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">b</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td title="c" title="b" align="left" width="25"><font face="Arial" size="2">CL</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">c</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td title="d" title="c" align="left" width="25"><font face="Arial" size="2">GL</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">d</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td title="e" align="left" width="25"><font face="Arial" size="2">FO</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">e</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td title="f" align="left" width="25"><font face="Arial" size="2">CD</font></td>     <td align="center" width="32"><font face="Arial" size="2">=</font></td>     <td width="317"><font face="Arial" size="2">f</font></td>   </tr>   <tr>     <td align="left" width="12"></td>     <td align="left" width="25"></td>     <td align="center" width="32"></td>     <td width="317"></td>   </tr> </table> <table border="0" cellpadding="0" cellspacing="1" width="890">   <tr>     <td align="left" width="884">       <p align="right"><b></font></td>   </tr> </table>

<table onMouseover="tooltip()" name="dokumente" border="1" width="889" height="1147" style="border-style: solid" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000">

<tr>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"> </td>     <td title="e" width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"><font size="2" face="Arial">FO</font></td>     <td width="460" height="19" bgcolor="#CCCCCC" style="border-style: solid"><a href=""><font size="2" face="Arial"></font></a></td>     <td width="204" height="19" bgcolor="#CCCCCC" style="border-style: solid"><font size="2" face="Arial"></font></td>     <td width="122" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="37" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>   </tr>   <tr>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"> </td>     <td title="b" width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"><font size="2" face="Arial">KFI</font></td>     <td width="460" height="19" bgcolor="#CCCCCC" style="border-style: solid"></td>     <td width="204" height="19" bgcolor="#CCCCCC" style="border-style: solid"></td>     <td width="122" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="37" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"><font size="2" face="Arial"></font></td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>   </tr>   <tr>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"><font size="2" face="Arial">FO</font></td>     <td width="460" height="19" bgcolor="#CCCCCC" style="border-style: solid"><a href=""><font size="2" face="Arial"></font></a></td>     <td width="204" height="19" bgcolor="#CCCCCC" style="border-style: solid"><font size="2" face="Arial"></font></td>     <td width="122" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="37" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"><font size="2" face="Arial"></font></td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>   </tr>   <tr>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"> </td>     <td width="34" height="19" bgcolor="#CCCCCC" align="center" style="border-style: solid"><font size="2" face="Arial">KFI</font></td>     <td width="460" height="19" bgcolor="#CCCCCC" style="border-style: solid"><a href=""><font size="2" face="Arial"></font></a></td>     <td width="204" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="122" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="37" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"><font size="2" face="Arial"></font></td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>     <td width="45" align="center" height="19" bgcolor="#CCCCCC" style="border-style: solid"> </td>   </tr>   </table>

<!--webbot bot="Include" U-Include="../../../_KB_central_definitions/Fusszeile.htm" TAG="BODY" -->

<font face="Arial">

</font></body> </html>