使用 jQuery 或 java 脚本首次加载时如何设置浏览器窗口的高度。当我第一次打开 index.html 页面时,我想将浏览器窗口高度设置为 400px。请告诉我该怎么做???
问问题
56 次
2 回答
1
On modern browsers, you cannot change the height of the window in the normal case. You can sometimes set the height of new windows you open via window.open
(although there are limitations on that, mostly around the minimum size), but not the user's main UI window containing the browser's tabs. The height of that window is for the user to decide, not the web pages he/she visits.
于 2013-09-18T07:12:50.777 回答
0
您不能直接更改当前窗口的大小。window.open
但是您可以更改使用方法打开的任何窗口的大小。要更改高度/宽度,您可以使用该window.resizeTo(width, height)
功能。不过,这仅适用于弹出窗口..
于 2013-09-18T07:28:53.853 回答