Bildanzeige

  • Bilder sind in der Regel groß - vor allem vom Speicherbedarf her. Meistens genügt jedoch die Darstellung einer kleinen Variante, die auf Wunsch vergrößert dargestellt wird. Das Beispiel hier zeigt einen Automatismus, der ein zusätzliches Fenster für die Bilddarstellung öffnet.

    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"><!--function bild(img_url, img_title, img_width, img_height){ wnd = open("", "Bildanzeige", "width=" + (img_width + 32) + ",height=" + (img_height + 64) + ",innerWidth=" + (img_width + 32) + ",innerHeight=" + (img_height + 64) +",toolbar=0,location=0,directories=0,status=0,menubar=0" + ",scrollbars=0,resizable,dependent") var baseadr = location.href var lastsl = location.href.lastIndexOf("") if(lastsl >= 0) baseadr = baseadr.substring(0, lastsl + 1) else { lastsl = location.href.lastIndexOf("/") if(lastsl >= 0) baseadr = baseadr.substring(0, lastsl + 1) } with(wnd.document) { open("text/html") writeln("<HTML>") writeln("<HEAD><TITLE>" + img_title + "</TITLE>") writeln("<BASE HREF="" + baseadr + ""></HEAD>") writeln("<BODY BGCOLOR=WHITE>") writeln("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=4 WIDTH="100%" HEIGHT="100%">") writeln("<TR><TD ALIGN=CENTER VALIGN=MIDDLE><IMG SRC="" + img_url + "" WIDTH=" + img_width + " HEIGHT=" + img_height + " HSPACE=0 VSPACE=0 ALT="" + img_title + ""></TD></TR>") write("<TR><TD ALIGN=LEFT VALIGN=BOTTOM><BIG><STRONG>") write("<A HREF="javascript:self.close()">Fenster schlie&WCF_AMPERSANDßen</A>") writeln("</STRONG></BIG></TD></TR>") writeln("</TABLE>") writeln("</BODY></HTML>") close() } wnd.focus()}//--></SCRIPT>

    <A HREF="javascript:bild('bild_gross.jpg', 'Bild in Gro&WCF_AMPERSANDßdarstellung', 400, 200)"><IMG SRC="bild_klein.jpg" WIDTH=100 HEIGHT=80 BORDER=0 ALT="Bild in kleiner Darstellung"></A>