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

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

问题描述

当您使用 JavaScript 向网页添加拖放功能(例如 jQuery UI 可拖放和可拖放)时,如何在移动设备上通过浏览器查看时使其工作 - 用于拖动的触摸屏操作是被手机拦截来滚动页面等?

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. 为移动设备提供一个按钮,可以抬起"要拖动的项目,然后让他们点击要放置项目的区域.

  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.

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

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

请提出您的建议和意见.

Your suggestions and comments please.

推荐答案

jQuery UI Touch Punch 可以解决所有问题.

jQuery UI Touch Punch just solves it all.

它是对 jQuery UI 的触摸事件支持.基本上,它只是将触摸事件连接回 jQuery UI.在 iPad、iPhone、Android 和其他支持触控的移动设备上进行了测试.我使用了可排序的 jQuery UI,它的作用就像一个魅力.

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天全站免登陆