使用 Javascript 缩放网页的所有内容
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3572483/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 01:33:34 来源:igfitidea点击:
Zoom all content of a web page using Javascript
提问by Rana
Is there a way to replicate or trigger the zoom feature of a web browser using Javascript?
有没有办法使用 Javascript 复制或触发 Web 浏览器的缩放功能?
回答by Todd H.
In javascript:
在 JavaScript 中:
document.body.style.zoom="300%"
回答by Ben Rowe
the css3 zoom property may help. This may not work accross all browsers.
css3 zoom 属性可能会有所帮助。这可能不适用于所有浏览器。
body {
zoom: 200%;
}

