Can I use drag and drop of html5 on mobile devices with phonegap?

妖精的绣舞 提交于 2019-12-10 14:57:52

问题


I need a drag and drop to mobile devices using phonegap. I tried with jquery mobile and jquery ui + jquery touch punch but html5 is better for me. Is it possible?

Thanks, Francisco

//EDIT

Here is a draggable image :

<a href="" name="cebra" draggable="true" ondragstart="dragUser(this, event)" > 
<img src="Imagenes/cebra.png" alt="cebra" width="150" height="100" id=""      style="background-color: #FFFFFF; display: block;" ; /> 
</a> 

and the function of javascript

function dragUser(user, event) { 
     event.dataTransfer.setData('User', user.id); 
 } 

I need to know if I can make a draggable image to android with the property draggable = "True" and phonegap. I can make this with jquery ui + jquery ui touch punch but could be better with html5 for my application.


回答1:


Hi Fransisco, Drag and drop feature can be added by using jQuery UI, and we have implemented this in web, android and iOS applications(Using phonegap also). So go ahead with this and please refer the following links,

  • http://jqueryui.com/draggable/
  • http://jqueryui.com/droppable/


来源:https://stackoverflow.com/questions/18975221/can-i-use-drag-and-drop-of-html5-on-mobile-devices-with-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!