how make draggable li element with jquerymobile?

谁说胖子不能爱 提交于 2019-12-18 12:44:38

问题


I am new in web mobile.

When i want to make draggable item in we i just use jquery ui, what is the way to do it in mobile web application?(i am using jquerymobile) Should we use jquery ui for that also in web mobile or exist other good way?

Thanks,


回答1:


jQuery mobile has no built in support for creating draggables. Bringing in jQuery UI to create draggables will work fine providing you bring in something to make touch events work (jQuery UI doesn't support touch events currently). jQuery UI Touch Punch is a good choice to provide such functionality.

A custom build of jQuery UI that only includes the draggable plugin and its dependencies is only 4 K minified. jQuery UI Touch Punch is 1/2 K. By comparison jQuery itself is 32 K. jQuery UI's draggable is quite robust so I think it's worth it.

There's some relevant discussion and a more lightweight solution in this answer as well - Javascript Drag and drop for touch devices.



来源:https://stackoverflow.com/questions/10693143/how-make-draggable-li-element-with-jquerymobile

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