非标准
该特性是非标准的,请尽量不要在生产环境中使用它!
The Window.sizeToContent()
方法根据窗口内容调整窗口大小。 为了使其工作,在调用此函数时应加载DOM内容,例如,一旦抛出 DOMContentLoaded
事件。
可以强行的调整窗口的最小尺寸。
语法
window.sizeToContent()
例子
window.sizeToContent();
规范说明
此功能不是任何规范的一部分
浏览器兼容说明
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.