Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zoom all content of a web page using Javascript

Is there a way to replicate or trigger the zoom feature of a web browser using Javascript?

like image 324
Rana Avatar asked Nov 20 '25 17:11

Rana


2 Answers

In javascript:

document.body.style.zoom="300%"
like image 115
Todd H. Avatar answered Nov 23 '25 07:11

Todd H.


the css3 zoom property may help. This may not work accross all browsers.

body {
  zoom: 200%;
}
like image 45
Ben Rowe Avatar answered Nov 23 '25 05:11

Ben Rowe