ipad拖放

我需要为Ipad实现拖放。

我试过这个解决方案: http : //www.gotproject.com/blog/post2.html

但由于我自己使用JQuery,它会发生冲突并且不起作用。

如何为IPad使用JQuery拖放?

如果您不使用jQuery UI,请使用我创建的分支https://github.com/mikeangstadt/jquery-ui-touch-punch.git通过触发已定义的鼠标事件来使用jQuery来连接触摸处理程序。

在iOS6上运行良好,尚未测试Android或其他。

工作:

首先,使用jquery UI http://jqueryui.com/demos/进行拖放function

然后添加此脚本https://github.com/furf/jquery-ui-touch-punch,以便在Ipad或Iphone中播放。

希望能帮助到你。

确认furf的jquery-ui-touch-punch可以在iPad上运行。

在包含jquery-ui和jquery本身之后,让它工作就像包含“jquery.ui.touch-punch.js”一样简单。 例如:

HTML:

      

使用Javascript:

 // // assume that html_string is a valid string // containing some element you want to be draggable // which needs to be added to the DOM // function addItemToUIList (list, html_string) { var item = $(list).append (html_string); // now, using jqui and touch-punch, we can make it draggable item.draggable (); } 

现在,“item”可以在ipad上的屏幕上以及桌面上的chrome中拖动。

Apple在此处有一个名为“处理多点触控事件”的部分: https : //developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

这是Apple官方指南,介绍如何使用UIKit中的标准控件和手势识别器处理几乎所有的触摸事件。

我已经解决了这个问题,请检查我的github: https : //github.com/youryss/fixdragtablet

我希望这个对你有用