Login/Register
iPhone / iPad / iPod swipe events javascript
Asked Answered
C

2

6

Im looking for (if possible) javascript libraries/plugins to provide swipe events.

However I am not after the simple detection of a swipe, for example what jqTouch provides. I wish to create behavior similar to that of the images viewer on the iPod devices. So for example you drag left or right to go to the next image. You have to drag the image over 50% of the way and let go and it will snap to the next image. If you do not drag 50% of the image, it just snaps back to the original.

Any advice appreciated. Thanks.

Crescin answered 8/9, 2010 at 10:30 Comment(0)
S
4

I think you might be looking for something like the Carousel component in Sencha Touch (view on iPad/iPhone or Chrome/Safari). This has the behavior you want built in. [I work for Sencha]

Sloan answered 9/9, 2010 at 18:17 Comment(3)
Thats just brilliant! Thanks. Are t here any APIs for this component? How do I make it not set the scale and scroll on the iPhone?Crescin
Yes it's part of an SDK - so you should look at dev.sencha.com/deploy/touch/docs for the APISloan
You're the man, Michael! No other libs (including jQuery Mobile) can do this so smooth like this one!Valdovinos
A
2

Here is a standalone solution for your problem:

http://swipejs.com/

The more general solution to javascript swipe events can be found here:

https://github.com/eikes/jquery.swipe-events.js

Applicatory answered 30/3, 2012 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.