I don't know any Java, so I need to borrow someone else's code so I can have a pop-up window appear with a full size image when someone clicks on a thumbnail. I'd prefer each new picture to replace the last. Can someone direct me to some free code?
Dead simple. Add the following to the header of any HTML file that you want to be able to link to a pop-up window from (between <HEAD> and </HEAD> ):
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
<SCRIPT LANGUAGE="JavaScript">
<!--
function popupwin(url,w,h){
newwin=window.open(url,'popupwin','width=' + w + ',height=' + h + ',resizable');
newwin.focus();
return false;
}
//-->
</SCRIPT>
[/code]
Replace linktothis.html with the file you want to load into the popup window, replace 550 with the desired width of the window, and replace 440 with the desired height of the window.
If the window is left open, clicking another link will load the specified file into the existing window, then bring that window to the foreground.
Browsers that don't support JavaScript (or have it disabled) will load the file into the current window like a normal link.
Hope this fits your needs! Oh, and for the record, this is JavaScript (code embedded in the HTML file), not Java (a separate program loaded into a Web page like an image). Java is a lot more complicated.
Bookmarks