Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html5 Drag and drop in Android

Tags:

html

android

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>
like image 367
R KiranKumar Avatar asked Jul 26 '12 13:07

R KiranKumar


1 Answers

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 mobile this jquery ui plugin works great on Android browser : http://touchpunch.furf.com/

Have fun

like image 81
Ghislain Avatar answered Nov 04 '22 23:11

Ghislain