Vic said:
Yes. you will need language like this:
==========================
<script language="JavaScript">
Type has superseded language and is both backward and
forward-compatible. So,
var popup=null;
function closePopUp() {
if (popup && !popup.closed) popup.close();
}
function popUp(url) {
url = String(url.href);
if (popup && !popup.closed) popup.open(url,"_self");
else popup = window.open(url,"_blank",<params>);
There are a few issues here.
First off, I wonder why you load an html file into a popup instead of
just the enlarged image.gif. It's faster to load just a .gif instead of
a full document.
Second, ennlarged images usually do not have the same dimensions. So
loading FullImage_2.htm into the dimensions of the popup when
FullImage_1.htm was created and opened will not make sense.
Third, if the popup just lost focus and the user clicks on the thumbnail
link again in the opener, then the popup will be reloaded when just
bringing it in front would be more efficient. To avoid this, you need to
compare the url.href value with a global variable storing the last
loaded enlarged image href value.
}
window.onunload = closePopUp;
</script>
<a onclick="popUp(this); return false;" href="FullImage_1.htm">
<img src="Thumbnail_1.gif">
</a>
Fourth, if javascript is disabled, the enlarged image won't be loaded in
a popup but rather in the same window. That's fine and acceptable with
me. I just thought the OP would want to open it in a secondary window as
well. If that's the case, then
<a onclick="popUp(this); return false;" href="FullImage_1.htm"
target="EnlargedImagePopup" title="Clicking this thumbnail will bring an
enlarged image in a separate window (requested popup)">
<img src="Thumbnail_1.gif">
</a>
An example of how all this could be:
http://www10.brinkster.com/doctorunclear/HTMLJavascriptCSS/EnlargeThumbnail.html
DU