HTML5拖放在Android中

HTML5拖放在Android中

本文介绍了HTML5拖放在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行一个简单的拖放在Android浏览器与HTML5。当我尝试只是拖动对象的屏幕滚动,我不能在其拖到什么。有没有办法做到这一点?

HTML是在这里:

 对于阻力:

< D​​IV ID =AN-OBJ-12可拖动=真正的ondragstart =拖(事件)悬浮窗=复制> 42A< / DIV>
< D​​IV ID =AN-OBJ-13可拖动=真正的ondragstart =拖(事件)悬浮窗=复制> 4A< / DIV>
< D​​IV ID =AN-OBJ-14可拖动=真正的ondragstart =拖(事件)悬浮窗=复制> 14< / DIV>

欲滴:

< D​​IV ID =AN-OBJ-7ondrop =滴(事件,12A ^ 2')ondragover =的AllowDrop(事件)>< / DIV>
< D​​IV ID =AN-OBJ-8ondrop =滴(事件,42A)ondragover =的AllowDrop(事件)>< / DIV>
< D​​IV ID =AN-OBJ-9ondrop =滴(事件,'4A')ondragover =的AllowDrop(事件)>< / DIV>
 

解决方案

HTML5拖放放大器;降不支持Android浏览器: http://caniuse.com/#search=drag

您可以使用第三方JS库效仿的是,像jQuery UI的

但你必须添加一个插件,使拖曳放大器;下降移动这个jQuery UI的插件的伟大工程的Andr​​oid浏览器: http://touchpunch.furf.com/

玩得开心

I tried to implement a simple drag and drop in the Android browser with HTML5. When I try to drag an object only the screen scrolls and I cant drag anything in it. Is there any way to do this?

HTML is here :

 For drag:

<div id="an-obj-12" draggable="true" ondragstart="drag(event)" dropzone="copy">42a</div>
<div id="an-obj-13"  draggable="true" ondragstart="drag(event)" dropzone="copy">4a</div>
<div id="an-obj-14"  draggable="true" ondragstart="drag(event)" dropzone="copy">14</div>

For drop:

<div id="an-obj-7" ondrop="drop(event,'12a^2')" ondragover="allowDrop(event)"></div>
<div id="an-obj-8" ondrop="drop(event,'42a')" ondragover="allowDrop(event)"></div>
<div id="an-obj-9" ondrop="drop(event,'4a')" ondragover="allowDrop(event)"></div>
解决方案

HTML5 Drag&Drop is not supported in Android Browser :http://caniuse.com/#search=drag

You can use a third party js library to emulate that,like jquery ui

but you have to add a plugin to enable drag&drop on mobilethis jquery ui plugin works great on Android browser :http://touchpunch.furf.com/

Have fun

这篇关于HTML5拖放在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 20:23