admin管理员组

文章数量:1328388

I'm making an offline version of an online products catalogue for the Ipad. It will be written in HTML5 / JS and utilise offline image caching and localstorage.

I want to be able to introduce the same UI interactions as e with the Ipad in terms of swiping. So if the user swipes from right to left, it will load the next product. If they swipe from left to right, it will load the previous image.

How do I capture this with Javascript ?

I'm making an offline version of an online products catalogue for the Ipad. It will be written in HTML5 / JS and utilise offline image caching and localstorage.

I want to be able to introduce the same UI interactions as e with the Ipad in terms of swiping. So if the user swipes from right to left, it will load the next product. If they swipe from left to right, it will load the previous image.

How do I capture this with Javascript ?

Share Improve this question asked Nov 21, 2011 at 7:36 32423hjh3242332423hjh32423 3,0887 gold badges46 silver badges62 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You can have a look at the events supported by mobile Safari here: http://developer.apple./library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

touchstart, touchmove and touchend events in particular

Or, if you don't want to reinvent the wheel, you can have a look at these scripts: http://cubiq/swipeview

http://plugins.jquery./project/swipe

本文标签: javascriptCapture the swipe effect to navigate to next page in HTML5 Ipad AppStack Overflow