Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

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

  • 1 antwurd
  • 1 hat dit probleem
  • 1 werjefte
  • Lêste antwurd fan 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?

Bewurke troch scratchresistor op

Alle antwurden (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.