我在js中有代码:
<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)并将其调整为图像的 X 和 Y(url 变量)。但问题是新窗口显示在屏幕的右上角并且也离开了屏幕。如何在屏幕中间显示窗口?