拖动& Drop on Safari iOS:无法拖动,不会响应桌面/ iPad上的放置 [英] Drag & Drop on Safari iOS: Wont drag, wont respond to drop on desktop/iPad

查看:460
本文介绍了拖动& Drop on Safari iOS:无法拖动,不会响应桌面/ iPad上的放置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编码一个要在iPad上查看的网页。它使用Safaris / Webkits拖&下降。我已经准确复制了Safari的例子drag&

我的问题:当我运行网页时,不会触发ondrop事件(HTML,CSS& Javascript )在Safari桌面上或iPad上的Safari上。在ipad我甚至不能拖动元素(显微镜的东西出现&它不会拖动,当我按住&移动我的手指在元素)。 。



出现了什么问题?



小代码示例可以在该页面的最底部: http://developer.apple。 com / library / safari /#documentation / appleapplications / Conceptual / SafariJSProgTopics / Tasks / DragAndDrop.html



这里是JSFiddle (请记住,拖放是Webkit所以只适用于Safari - 此网页仅用于ipad): http://jsfiddle.net/eyM3y/

解决方案

替代方法:



用于拖放功能的用户界面 http://jqueryui.com/demos/



,然后添加此脚本 https://github.com/furf/jquery-ui-touch-punch

希望它有帮助。


I am coding a webpage to be viewed on iPad. It uses Safaris/Webkits drag & drop. I have exactly copied Safari's example drag & drop code but it wont work.

My Problem: The ondrop event is never triggered when I run the webpage(HTML, CSS & Javascript) on Safari Desktop or on Safari on an iPad. On ipad I cannot even drag the elements(the microscope thingie appears & it wont drag when I hold & move my finger over the element). The drag does work on desktop though.

Whats going wrong?

The small code example can be found at the very bottom of this page: http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/SafariJSProgTopics/Tasks/DragAndDrop.html

Here is the JSFiddle(remember the drag & drop is Webkit so only for Safari-this webpage is for ipad only): http://jsfiddle.net/eyM3y/

解决方案

Working alternative :

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.

Hope it helps.

这篇关于拖动& Drop on Safari iOS:无法拖动,不会响应桌面/ iPad上的放置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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