如何使用jquerymobile制作可拖动的li元素? [英] how make draggable li element with jquerymobile?

查看:65
本文介绍了如何使用jquerymobile制作可拖动的li元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是网络移动领域的新手.

I am new in web mobile.

当我想在我们中使用可拖动项目时,我只使用jquery ui,在移动Web应用程序中该怎么做?(我正在使用jquerymobile) 我们是否应该在移动网络中也使用jquery ui或存在其他好的方式?

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?

谢谢

推荐答案

jQuery mobile不支持创建可拖动对象.引入jQuery UI来创建可拖动对象可以很好地工作,只要您引入一些使触摸事件起作用的功能(jQuery UI当前不支持触摸事件). jQuery UI Touch Punch 是提供此类功能的不错选择.

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.

仅包含可拖动插件及其依赖项的jQuery UI的自定义版本仅压缩了4K. jQuery UI Touch Punch是1/2K.相比之下,jQuery本身是32K.jQueryUI的可拖动性非常强大,因此我认为这是值得的.

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.

此答案中也有一些相关的讨论和更轻巧的解决方案- Javascript拖放触摸设备.

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

这篇关于如何使用jquerymobile制作可拖动的li元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆