I have a javascript function for displaying an image in a new window
However, I have to tell the function the exact size of the image
Is there some way it can work out the size of the image automatically?
[code]<script language=”JavaScript” type=”text/JavaScript”>
<!–
function ShowPicture(picURL, width, height){
var leftVal = (screen.width-width) / 2;
var topVal = (screen.height-height) / 2;
newWindow=window.open(‘picURL’,’newWin’,’toolbar=no,width=’+width+’,height=’+height+’,left=’+leftVal+’,top=’+topVal)
newWindow.document.write(‘<html><head></head><body topmargin=”0″ leftmargin=”0″ rightmargin=”0″ bottommargin=”0″><img src=”‘+picURL+'”></body></html>’)
newWindow.focus()
}
//–>
</script>