hi there, I have a image gallery as thumbnails on one page, when a thumbnail is clicked I want the full version of the image in a new window with its dimensions. Now I got it working but I don't think this is a effecient way. Any ideas? Thanks. Actually I only have one pic to open but I would like the script to work for multiple thumbnails.
<script language=javascript>
function openPic(url){
newWindow=window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
newWindow.document.write('<html><title></title><head></head>')
newWindow.document.write('<body onLoad="self.resizeTo(document.images[0].width,document.images[0].height);" topmargin="0" leftmargin="0"><img src="'+url+'"></body></html>')
newWindow.location.reload();
newWindow.focus();
}
</script>
<td colspan=2><a href="JavaScript:void(0);" onClick="openPic('images/girl.jpg');" border=0>
<img src="images/girl_tn.jpg" width=85 height=55 border=0></a></td>
<script language=javascript>
function openPic(url){
newWindow=window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
newWindow.document.write('<html><title></title><head></head>')
newWindow.document.write('<body onLoad="self.resizeTo(document.images[0].width,document.images[0].height);" topmargin="0" leftmargin="0"><img src="'+url+'"></body></html>')
newWindow.location.reload();
newWindow.focus();
}
</script>
<td colspan=2><a href="JavaScript:void(0);" onClick="openPic('images/girl.jpg');" border=0>
<img src="images/girl_tn.jpg" width=85 height=55 border=0></a></td>