Is there any way to change the browser zoom with JavaScript
?
When loading script
you would like to change the browser zoom to 100%, it can be using any (Angular, jQuery) framework.
I would be very grateful if you could help.
Is there any way to change the browser zoom with JavaScript
?
When loading script
you would like to change the browser zoom to 100%, it can be using any (Angular, jQuery) framework.
I would be very grateful if you could help.
See this answer.
In short you can use:
document.body.style.zoom = 1.0
But this property is not standard for all browsers .
Instead use tranforms:
var scale = 'scale(1)';
document.body.style.webkitTransform = scale; // Chrome, Opera, Safari
document.body.style.msTransform = scale; // IE 9
document.body.style.transform = scale; // Geral
document.body.style.zoom = "200%"
<p>Olá, mundo!</p>
I tested this code in IE and CHROME. But I believe it to be Cross-Browser.