Dancer
Dancer

Reputation: 17701

IOS HTML5 App - Jquery slider allows click action also

I am building a HTML5 IOS app - which has a over-complicated brief!

Basically I am building a workout guide - The functionality requires a user to swipe left and right to reveal alternate tables of exercises - the user can expand and contract each table cell to reveal detailed exercise information and can also click a tick box to disable the cell when the task is completed.

So basically I need to have a swipe slider script which doesn't overrule click actions within the slider area - so I can trigger other scripts to make th functionality work.

I began using this library - http://swipejs.com/ which swipes nicely - but doesn't allow clicks/taps within the slider when running on an iphone.

Can anyone recommend a method/library that would allow me to do whats required?

Upvotes: 2

Views: 225

Answers (1)

BenM
BenM

Reputation: 53246

Shameless plug here I know, but I think the library I wrote a few months ago should achieve what you're after: https://github.com/benmajor/jQuery-Mobile-Events

You can easily bind several events to the slider:

$('#slider').swiperight(function() {  
    // Do something here when the user swipes right.
}).swipeleft(function() {  
    // Do something here when the user swipes left.
}).singletap(function() {  
    // Finally, handle the tap event.
});

Upvotes: 2

Related Questions