I wrote this a long time ago and it seems to get posted in the forums quite a bit so I figured I post it here for easy reference:
<!--// Parameter list as follows:
Image File
Title of Image
Width of Image
Height of Image
Window Position X coordinate
Window Position Y coordinate
//-->
Example of use:
If you want to use this download the attached text file instead of copying and pasting from the screen here. The forum keeps putting spaces in the coding when copying and pasting causing the script to have an error.
Code:
<script language="Javascript" type="text/javascript"> <!--// function imageView(imgFile,imgTitle,imgWidth,imgHeight,winPosX,winPosY){ preview = window.open("","","resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width="+imgWidth+",height="+imgHeight+",left="+winPosX+",top="+winPosY+""); preview.document.write('<html><head><title>'+imgTitle+' - Click to close - <\/title><\/head>' +'<body onBlur="self.focus();" marginWidth="0" marginHeight="0" topmargin="0" leftmargin="0">' +'<center>' +'<a href="java script:self.close()">' +'<img border="0" alt="Image loading please wait...." src="'+imgFile+'" width="'+imgWidth+'" height="'+imgHeight+'">' +'<\/a><\/center>' +'<\/body><\/html>'); preview.document.close(); } //--> </script>
<!--// Parameter list as follows:
Image File
Title of Image
Width of Image
Height of Image
Window Position X coordinate
Window Position Y coordinate
//-->
Example of use:
Code:
<a href="javascript:imageView('images/australia08.jpg','Australian Limestone Desert',427,277,50,50)"> <img src="images/australia08thumb.jpg" width="84" height="55" border="0" alt="Click for larger image"></a>
Comment