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

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

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 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!