Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

تلاش سپورٹ

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

مزید سیکھیں

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

  • 1 جواب دیں
  • 1 میں یہ مسئلہ ہے
  • 105 دیکھیں
  • آخری جواب بذریعہ Matt Brubeck
  • آرکائیو شدہ

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?

scratchresistor کی جانب سے میں ترمیمکی گئ

تمام جوابات (1)

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.