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

查看:18
本文介绍了如何使用 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 的自定义构建仅缩小了 4 K.jQuery UI Touch Punch 是 1/2 K.相比之下,jQuery 本身是 32 K.jQuery UI 的可拖动性非常强大,所以我认为这是值得的.

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天全站免登陆