hi,
ich möchte auf einer Website die Bilder vorladen.
Wie setzt ich soetwas am besten um?
du kannst folögenden Code nehmen:
function bild(img_url, img_title, img_width, img_height)
{
wnd = open("",
"Bildanzeige",
"width=" + (img_width + 32) + ",height=" + (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=C0C0C0 link=000000>")
writeln("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=4 WIDTH="100%" HEIGHT="100%">")
writeln("<TR><TD ALIGN=CENTER VALIGN=CENTER><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()"><font face=Arial size=1>Fenster wieder schließen</font></A>")
writeln("</STRONG></BIG></TD></TR>")
writeln("</TABLE>")
writeln("</BODY></HTML>")
close()
}
wnd.focus()
das rufst du dann im body wieder auf. Vielleicht so:
<table border="2" width="300">
<tr>
<td width="20%"><center><a
HREF="javascript:bild('../../grafik/frac01.jpg', 'Fractal-Grafik', 400, 300)"><img
SRC="../../grafik/frac01.jpg" WIDTH="60" HEIGHT="45" BORDER="0"></a></td>
<td width="20%"><center><a
HREF="javascript:bild('../../grafik/frac02.jpg', 'Fractal-Grafik', 400, 300)"><img
SRC="../../grafik/frac02.jpg" WIDTH="60" HEIGHT="45" BORDER="0"></a></td>
Christoph S.