拖曳下载Safari iOS:不会拖动,不会回应桌面/ iPad上的下降 [英] Drag & Drop on Safari iOS: Wont drag, wont respond to drop on desktop/iPad

查看:157
本文介绍了拖曳下载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/

解决方案

工作方式:



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



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



希望它有帮助。 >

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.

这篇关于拖曳下载Safari iOS:不会拖动,不会回应桌面/ iPad上的下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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