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

321
Vistas
How to create a zoom in and zoom out icon in flask app?

I have created a flask based UI where there are several html files inside templates and python main.py file. Below is a screenshot of my UI webpage:

enter image description here

As you can see there are two navigation tabs, Reports and Insight Engine.

In this page, I want to make a zoom in and zoom out button at right upper corner. Zoom out button will decrease the webpage size to 80% and zoom in button will increase the webpage size to 120%. They should work similar to ctrl+ and ctrl- in windows. These buttons should be available for both the navigation tabs.

This is my directory structure:

/static
  /design.css
/templates
  /index.html
  /upload.html
  /engine.html
/main.py

How can I achieve this?

I am not attaching any code because I didn't try any solution as I didn't find any.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You could use the zoom CSS property :

document.querySelector("#zoom").addEventListener("click", function(){
  document.body.style.zoom = 1.0;
});

document.querySelector("#zoomout").addEventListener("click", function(){
  document.body.style.zoom = 0.8;
});

document.querySelector("#zoomin").addEventListener("click", function(){
  document.body.style.zoom = 1.2;
});
<button id="zoomout">Zoom -</button>
<button id="zoom">Restore zoom</button>
<button id="zoomin">Zoom +</button>

Note that it is not supported on Firefox.

about 4 years ago · Santiago Trujillo 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