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

163
Visualizações
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 à 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