Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!