JQuery UI Drag and Drop在ipad和iphone上的解决办法

本文介绍了在iPad和iPhone等iOS设备上实现JQueryUI拖拽功能遇到的问题及解决方案,包括使用event.preventDefault()、jquery-ui-touch-punch插件、MobileDragandDrop库等多个方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

JQuery UI的Drag and Drop插件可以很好的实现网页上的拖拽功能,但是在iPad和iPhone上似乎不能很好的支持,搜找了网上也有类似的问题,已经有解决办法。


1. 使用event.preventDefault()
    http://stackoverflow.com/questions/4488601/jquery-draggable-images-on-ipad-iphone-how-to-integrate-event-preventdefau/4488662#4488662

2. jquery-ui-touch-punch
    http://stackoverflow.com/questions/3279477/ipad-drag-and-drop

    1) Firstly, use jquery UI http://jqueryui.com/demos/ for drag and drop functionality and then add this script https://github.com/furf/jquery-ui-touch-punch for playing it in Ipad or Iphone.
    http://touchpunch.furf.com/

    2) If you aren't using jQuery UI, use the fork I created https://github.com/mikeangstadt/jquery-ui-touch-punch.git to hook up touch handler's using jQuery by firing the already defined mouse events.

3. Mobile Drag and Drop
    http://www.stevefenton.co.uk/cmsfiles/assets/File/mobiledragdrop.html

4. jquery ui for ipad and iphone
    http://code.google.com/p/jquery-ui-for-ipad-and-iphone/

5. hammer.js
    https://github.com/EightMedia/hammer.js


另外 jQuery 也有 mobile 库 http://jquerymobile.com/ 或许对支持移动端的网页开发有用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值