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

164
Vistas
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
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