开发者

Drag and drop on iPad

开发者 https://www.devze.com 2023-04-06 17:25 出处:网络
I have a webpage that features jQuery drag and drop. It works on all desktop browsers but not on iPads. Somehow the click + drag event is captured to move the page up and down.

I have a webpage that features jQuery drag and drop. It works on all desktop browsers but not on iPads. Somehow the click + drag event is captured to move the page up and down.

So, how is drag-and-drop generally done on iPads without 开发者_运维问答writing iPad apps?


You can't use the mouse events ... you need to change to touch events

http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/

One way is to divide both code using a mobile Framework, like jQTouch, jQMobile, etc...

Here is a simple test using jQTouch


Just added a simple test of my own

using jQuery UI Sortable for both Browser and iPad

http://jsbin.com/ujeyac/19/

using jQuery UI Sortable demo code and the Touch Events code, works great!

0

精彩评论

暂无评论...
验证码 换一张
取 消