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

129
Visualizações
jQuery mousewheel event - javascript equivalent

I'm using a mousewheel / wheel event to zoom in/out on my page. When I call it with el.on("mousewheel DOMMouseScroll", functionName) jQuery handler, it runs smoothly and everything works fine, event.delta has consistent values.

On the other hand, when I call the same function with el.addEventListener("wheel", functionName), the scroll is all over the place, sometimes it triggers, sometimes it doesn't, event.deltaY changes the sign depending on how it feels at the moment, unrelated to the direction of my wheel.

Is there a way to achieve the smoothness of the jQuery event without loading the whole library only for that single purpose? How would I go about writing/finding the equivalent?

Solved: The event wasn't causing the stutter, event.deltaY property was. Javascript wheel property event.wheelDeltaY is the equivalent to jQuery's event.delta.

Object documentation Thank you @CBroe

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