HTML拖放在移动设备上 [英] HTML Drag And Drop On Mobile Devices

查看:108
本文介绍了HTML拖放在移动设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您使用JavaScript(例如jQuery UI可拖放和可拖放)将JavaScript拖放到网页中时,如何在通过移动设备上的浏览器查看时使其发挥作用 - 拖动的触摸屏操作是

所有解决方案都欢迎......我最初的想法是:


  1. 为移动设备设置一个按钮,用于抬起要拖动的项目,然后让它们点击要放置该项目的区域。


  2. 编写一个应用程序,它可以为移动设备执行此操作,而不是尝试让网页在其上运行!

  3. >您的建议和意见请。

更新:赏金



如果有人能告诉我如何在移动设备的网页上进行拖放工作,而不诉诸上面的第1点和第2点,我会以您的方式摆动50代表的美妙赏金!

解决方案

jQuery UI Touch Punch只是解决了这一切。

这是一个支持jQuery UI的触摸事件。基本上,它只是将触摸事件连接回jQuery UI。
在iPad,iPhone,Android和其他支持触摸的移动设备上进行测试。
我使用jQuery UI排序,它的工作原理就像一个魅力一样。



http://touchpunch.furf.com/


When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, how do you get this to work when viewed via a browser on a mobile device - where the touch-screen actions for dragging are intercepted by the phone for scrolling around the page etc?

All solutions welcome... my initial thoughts are:

  1. Have a button for mobile devices that "lifts" the item to be dragged and then get them to click the zone they want to drop the item on.

  2. Write an app that does this for mobile devices rather then try and get the web page to work on them!

  3. Your suggestions and comments please.

UPDATE: Bounty

If someone can tell me how to make drag and drop work in a web page on a mobile device, without resorting to points 1 and 2 above, I will swing a wonderful bounty of 50 rep your way!

解决方案

jQuery UI Touch Punch just solves it all.

It's a Touch Event Support for jQuery UI. Basically, it just wires touch event back to jQuery UI. Tested on iPad, iPhone, Android and other touch-enabled mobile devices. I used jQuery UI sortable and it works like a charm.

http://touchpunch.furf.com/

这篇关于HTML拖放在移动设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆