獲取圖片尺寸來顯示窗口大小。
<script LANGUAGE="JavaScript">
<!--
function showImg(url)
{
var hplus = 30
if(window.navigator.userAgent.indexOf("SV1") != -1){hplus = hplus + 20;}
newwin = window.open("about:blank","","width=1,height=1,left=2,top=2")
newwin.document.write ('<html><title>View Image </title><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head><body style="border:0px;margin:0px;" onkeydown=if(event.keyCode==27){window.close()}><center><img title="Click Colse Window" onclick="window.close()" style="cursor:hand;" border="0" src="'+url+'" align="absmiddle" hspace="0" vspace="0" onload="self.resizeTo((this.offsetWidth+10),(this.offsetHeight+'+hplus+'));"></center></body></html>')
}
//-->
</script>