I have implemented a photo gallery of thumbnail images that enlarge in a separate window when clicked. My problem is that once the enlarged image appears and that window is closed, the user is left at the very top of the page instead of at the location they were when they clicked the image.
Here is a snippet of the html code (the images are in a table):
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr align="center">
<td><a href="#" onClick="TS_openWindow('img/gallery/kitchens/kit1.jpg','pop','width=800,height=533')"><img src="img/gallery/kitchens/thumbs/kit1thumb.jpg" width="200" height="133" border="0"></a></td>
<td><a href="#" onClick="TS_openWindow('img/gallery/kitchens/kit2.jpg','pop','width=800,height=533')"><img src="img/gallery/kitchens/thumbs/kit2thumb.jpg" width="200" height="133" border="0"></a></td>
Here is the javascript I am using:
function TS_openWindow(url, name, args) {
if (typeof(popupWin) != "object"){
popupWin = window.open(url,name,args);
} else {
if (!popupWin.closed){
popupWin.location.href = url;
} else {
popupWin = window.open(url, name,args);
}
}
popupWin.focus();
}
Any help figuring out how to get the user to return to their original location within the webpage after closing the pop out window would be greatly appreciated!!