Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

317
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda