|
<script language="JavaScript"> <!-- // Thumbnail Script // (c) RJHM van den Bergh/comweb.nl, 2001 // support@comweb.nl // // This script opens a enlarge picture of a thumbnail. // With the onUnload you can close the enlarged thumbnail when the user leaves the page. // var popupHandle; function popup(picUrlString, windowWidth, windowHeight) { // always close the old one , so only one at a time is open if(popupHandle || popupHandle!=null) { if (!popupHandle.closed) popupHandle.close(); } popupHandle=null; // create a feature string for the popup var x=(screen.width-windowWidth)/2 var y=(screen.height-windowHeight)/2 var featureString = "toolbar=no,scrollbars=no,resizable=no" featureString = ',left='+x + ',top='+y featureString += ',width='+windowWidth+',height='+windowHeight // open the popup // We use a php script to work arround some browser specific problems // Opera doesn't seem to handle document.close() correctly on the popup. popupHandle = window.open( "popup.php3?windowWidth="+windowWidth+"&windowHeight="+windowHeight+"&picUrlString="+picUrlString ,"popup",featureString) return popupHandle; } function winclose() { if (window.popupHandle!=null && !window.popupHandle.closed) { window.popupHandle.close(); } } function doNothing(){} // does nothing but required by JavaScript in this case //--> </SCRIPT> |
|
<BODY onUnload="winclose();"> |
|
<A HREF="JAVASCRIPT:doNothing();" onclick="popupHandle=popup('my_large_picture.jpg','512','315')" > <IMG SRC="my_small_picture.jpg" onmouseover="window.status='Click to enlarge'; return true;" onmouseout="window.status=''" border="0" WIDTH="200" HEIGHT="123" TITLE="Click to enlarge"> </A> |
|
<HTML> <HEAD> <TITLE>Click to close.</TITLE> </HEAD> <BODY marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgcolor=black text="white" onclick="self.close()"> <A HREF="javascript:window.close();" title="Close." > <IMG SRC="<? echo htmlspecialchars($_GET['picUrlString']); ?>" BORDER="0" WIDTH="<? echo (int)$_GET['windowWidth']; ?>" HEIGHT="<? echo (int)$_GET['windowHeight']; ?>"></A> </BODY> </HTML> |
|
<script language="JavaScript"> <!-- // Thumbnail Script // (c) RJHM van den Bergh/comweb.nl, 2001 // support@comweb.nl // // This script opens a enlarge picture of a thumbnail. // With the onUnload you can close the enlarged thumbnail when the user leaves the page. // var popupHandle; function popup(picUrlString, windowWidth, windowHeight) { // Always close the old one, so only one at a time is open if(popupHandle || popupHandle!=null) { if (!popupHandle.closed) popupHandle.close(); } popupHandle=null; // create a feature string for the popup var x=(screen.width-windowWidth)/2 var y=(screen.height-windowHeight)/2 var featureString = "toolbar=no,scrollbars=no,resizable=no" featureString = ',left='+x + ',top='+y featureString += ',width='+windowWidth+',height='+windowHeight // html content of the popup var htmlString = "<html><head><title>Click to close.</title></head>" htmlString += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgcolor=black text=\"white\" onclick=\"self.close()\">" htmlString += "<A HREF=\"javascript:window.close();\" title=\"Close.\" >" htmlString += "<IMG SRC=\"" + picUrlString + "\" BORDER=\"0\" WIDTH=" + windowWidth + " HEIGHT=" + windowHeight + "></A>" htmlString += "</body></html>" popupHandle = window.open("" ,"popup",featureString) popupHandle = window.open("" ,"popup") popupHandle.document.clear(); popupHandle.document.writeln(htmlString); popupHandle.focus(); popupHandle.document.close(); // should trigger the picture loading. return popupHandle; } function winclose() { if (window.popupHandle!=null && !window.popupHandle.closed) { window.popupHandle.close(); } } function doNothing(){} // does nothing but required by JavaScript in this case //--> </SCRIPT> |