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

160
Views
Click event when css zoom is applied to the body - chrome update

On a web application, I need to get the coordinates of the mouse click. On my page, I apply a zoom of 0.8 to the body body{ zoom: 0.8;} when the width is lesser than 400px.

The click event has/had a feature where if zoom was applied to the body, the coordinates weren't correct (as seen on this question), so, we need to compensate the zoom by doing

var coordX = event.clientX / zoom;
var coordY = event.clientY / zoom;

Now, with one of the newer updates of the Chrome (I can't figure out the exact version, but on the 94 this is true) it seems that the click event takes in consideration the zoom property, which means, the previous code I had var coordX = event.clientX / zoom; is wrong.

The problem is that I can't find any documentation that can corroborate my theory.

So, if I change my code, I know it will work for those who has the latest version of Chrome and it will not work on previous versions. But because I can't be sure that my theory is correct (without documentation proving it) I'm a little concerned on updating based on a "hunch".

Can anyone confirm my suspicions?

about 4 years ago · Juan Pablo Isaza
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!