|
How do I make a quick preview window?
|
 |
If you want your visitors to click on a thumbnail image and then the full picture loads in a new window, insert the following code into your HTML:
(You must change everything in Red, everything in Orange is optional)
- Put this in the HEAD tag of your HTML document:
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
timeout =0;
function Start(URL, WIDTH, HEIGHT) {
windowprops = "left=50,top=50,width=" + (WIDTH+50) + ",height=" + (HEIGHT+50);
text = "<html> <head> <title>Image Preview </title> </head> <body bgcolor='white'";
if (timeout != 0) text +=" onLoad=\"setTimeout('window.close()', " + timeout*1000 + ");\"";
text += "> <center> <img src='" + URL + "'>";
if (timeout != 0) text +="<br><font face='arial, helvetica' size='-1'>Preview closes after " + timeout + " seconds.</font>";
text += "</center></body></html>";
preview = window.open("", "preview", windowprops);
preview.document.open();
preview.document.write(text);
preview.document.close();
}
// End -->
</script>
</HEAD>
- Then put this after the BODY tag when you would like the the preview image to appear:
<BODY>
<a href="javascript:Start('http://image source', 267, 103)";> <img src="http://same image source" width=86 height=51> </a>
It will appear like this in your page:
Notes:
- timeout =0 can be changed to have the window close, replace 0 with the number of seconds you would like the window to remain open.
|
|