Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Learn More

How do I override browser swipe gestures to implement on-page swipe gestures in JavaScript?

  • 1 resposta
  • 1 tem este problema
  • 1 visualização
  • Última resposta de Matt Brubeck

more options

I've developed a site which uses left and right swipe gestures implemented in JavaScript to scroll through a carousel. However, these are ignored and are interpreted as usual by Firefox, showing either the tabs or navigation sidebar (right and left swipes respectively). Is there any way of overriding this behaviour?

I've developed a site which uses left and right swipe gestures implemented in JavaScript to scroll through a carousel. However, these are ignored and are interpreted as usual by Firefox, showing either the tabs or navigation sidebar (right and left swipes respectively). Is there any way of overriding this behaviour?

Alterado por scratchresistor em

Todas as respostas (1)

more options

You will need to use touch events to listen for swiping in mobile browsers:

https://developer.mozilla.org/en/DOM/Touch_events

If you call preventDefault() on the touchstart event, it will prevent the browser from scrolling the content.