Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

522
Vistas
Control browser zoom with javascript buttons

Hi I've seen a few ways to control the size of text with JavaScript but I always find the best way to zoom in and out is when I use ctrl - cmd & +/- on responsive layouts.

I quite like how my mobile / tablet layout looks in a browser zoomed in. Is there a way to use JavaScript buttons to actually control the web browser's zoom functionality. So the click of a plus button would have the same effect as ctrl - cmd & +? Rather than mimic the functionality I want it to actually control the browsers zoom functionality.

I've played about with this css and I could use Javascript to increase and decrease the level:

body {
   -moz-transform: scale(2);
   zoom: 2;
   zoom: 200%;
}

but while this does zoom in it also gives horizontal scroll bars and therefore never shows tablet or mobile layouts that I have created.

Is there a way to do it in Javascript? I need it to be cross browser, available to the public and not involve any dev tools.

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

What about responsive layout in chrome dev tools? https://developer.chrome.com/docs/devtools/device-mode/

Then change it to mobile or tablet device then you can zoom in by using:

document.body.style.zoom = "100%";
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda