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 mobile this jquery ui plugin works great on Android browser : http://touchpunch.furf.com/
Have fun
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With