This is a migrated thread and some comments may be shown as answers.

Is there a way to disable swipe events?

0 Answers 129 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 10 Nov 2012, 11:33 PM
I'm using a ScrollView as a carousel to house some questions and need to disable swipe events for it (I'm using "next" and "previous" buttons to control it). The problem I'm coming across is that I have a jQuery-UI slider inside the ScrollView, but when I try to change the slider value, it starts to move the ScrollView to the next "page".

I was hoping there was a native way to disable "swipe to move", but it doesn't appear that there is.

I've played around with catching the events on the ScrollView pages, but haven't been able to get something that works on an actual device:
$('#scrollview-container [data-role="page"]').on('mousedown', function(e) {
     console.log('mousedown');
     e.stopImmediatePropagation();
 });
 $('#scrollview-container [data-role="page"]').on('touchstart', function(e) {
     console.log('touchstart');
     e.stopImmediatePropagation();
 });

Any ideas or help would be appreciated.

No answers yet. Maybe you can help?

Tags
ScrollView (Mobile)
Asked by
M
Top achievements
Rank 1
Share this question
or