1
我在JS代碼:如何在javascript中的屏幕中間顯示新窗口?
<script>
function displayWindow(url, w, h)
{
var win = window.open("zoom.htm","displayWindow",'width='+w+', height='+h+',resizable=yes,scrollbars=yes,menubar=no');
win.document.write("<html><body onclick=window.close()>");
win.document.write("<img id=fullimg src=" + url+">");
win.document.write("</body></html>");
var image = win.document.getElementById("fullimg");
win.resizeTo(image.width + 50, image.height + 50);
}
</SCRIPT>
Java腳本在新窗口打開(文件zoom.html),並調整其大小○×和圖像的Y(URL varriable)。但問題是新窗口顯示在屏幕的右上角,並且也不在屏幕上。如何在屏幕中間顯示窗口?