Arthur Dent: Anzeige bzw. "onClick" funktioniert nicht

Beitrag lesen

Hallo nochmal,
...also ich bin bin wohl nicht DER Arthur Dent.

Mit dem restlichen Quelltext ist das so ein Problem, da das ganze nicht online ist (es ist Teil einer Fotogalerie, die von CD gestartet wird -> falls es dich interessiert: http://forum.de.selfhtml.org/archiv/2004/3/75330/#m433840 )

Deshalb hier eine gekürzte Fassung (ich hoffe, es wird nicht zu unübersichtlich)

...
<script type="text/javascript">
 <!--
 var height = 560;
 var width = 450;
 var top = Math.round((screen.height - height) / 2);
 var left = Math.round((screen.width - width) / 2);

document.writeln('<img src="../bilder1/bild1.jpg" name="bild1">');
...
document.writeln('<img src="../bilder4/bild1.jpg" name="bild4">');

function MakeTable() {
    var w = new Array();
   var h = new Array();
   w[1] = document.bild1.width;
 h[1] = document.bild1.height;
        ...
   w[4] = document.bild4.width;
   h[4] = document.bild4.height;

// Groesse der Thumbnails festlegen ( ~ proportional zur Originalgroesse )
 for ( i=1; i<=4; i++) {
       if (w[i] > h[i] ) {
   w[i] = 160;
   h[i] = 120;
       }
         else if (w[i] < h[i] ) {
   w[i] = 120;
   h[i] = 160;
       }
       else if (w[i] == h[i] ) {
   w[i] = 160;
   h[i] = 160;
       }
      } // END for

document.close();
document.open("text/html");
document.writeln('<title>Fotogalerie</title>');
document.writeln('<link rel="stylesheet" type="text/css" href="../_style/styles.css">');

document.writeln('<body class="rahmen">');
document.writeln('<h1 align="center">Fotogalerie</h1>');
document.writeln('<marquee loop="infinite" scrollamount="5" scrolldelay="1">');
document.writeln('<p>blablabla</p>');
document.writeln('</marquee>');
document.writeln(' ');

// Tabelle fuer Thumbnails erzeugen:
document.writeln('<table width="90%" class="bground" id="tpix" cellspacing="10" cellpadding="0">');
document.writeln('<colgroup width="180" span="5">');
document.writeln('</colgroup>');
 document.writeln('<tr>');
  document.writeln('<td align=right height="160"   style="border:0"><p><b>Galerie 1</b></p></td>');
  document.writeln('<td align=center height="160" style="border:0"><a href="galerie1.htm"><img src="../bilder1/bild1.jpg" width="' + w[1] + '" height="' + h[1] + '"  alt=" -= Zu Galerie 1 =-" border="0" align="center" style="cursor:hand"/></a></td>');
...(weitere Tabellenzellen)

document.writeln('</tr>');
document.writeln('</table>');

=> aus vorherigem Posting:
// Tabelle 1
        document.writeln('<p class="space1">');
        document.writeln('<table width="60%" align=center class="bground" id="tbut" cellspacing="10" cellpadding="0">');
        document.writeln('<tr>');
        document.writeln('<td id="cellb" align=center title="Galerie verlassen" onclick="self.close(); opener.location.href='close.htm'" style="cursor:hand"><p><b> -= Galerie verlassen =- </b></p></td>');
        document.writeln('</tr>');
        document.writeln('</table>');

// Tabelle 2
        document.writeln('<p class="space1">');
        document.writeln('<table width="30%" align=center class="bground" id="tbut" cellspacing="10" cellpadding="0">');
        document.writeln('<tr>');
        document.writeln('<td id="cellb" align=center title="Impressum/Kontakt" onClick="window.open('credits.htm','Credits','width='+width+',height='+height+',left='+left+',top='+top+',menubar=no,location=no,toolbar=no,dependent=yes')" style="cursor:hand"><p><b> -= Impressum =- </b></p></td>');
        document.writeln('</tr>');
        document.writeln('</table>');

} // END function MakeTable()
//-->
</script>

</head>
<body onLoad="MakeTable()">

</body>
</html>

Nochmal zur Erinnerung: alles bis auf Tabelle 2 wird richtig dargestellt und die hinterlegten Funktion funktionieren auch.

Nochmal sorry wegen dem Quelltext-Posten, aber es geht nicht anders...

Gruß,
Arthur