Drag and drop without JQuery UI(没有 JQuery UI 的拖放)
问题描述
我搜索了很多内容以找到有关拖动 & 的教程.drop 单独使用 jQuery(没有 UI),但是由于 JQuery UI 的流行,所有的拖放功能都基于 JQuery UI.
I searched a lot to find a tutorial for drag & drop with jQuery alone (without UI), but due to the popularity of JQuery UI, all drag and drop features are based on JQuery UI.
谁能给我一个提示如何制作一个基本的 Drag &单独使用 JQuery 吗?
Can anyone give me a hint how to make a basic Drag & Drop by JQuery standalone?
推荐答案
我认为一个好的起点可能是规划流程,然后决定每个用户操作需要使用哪些 jQuery 工具.
I think a good starting place might be to map out the process, and then decide which jQuery tools you will need to use for each user action.
所以用户进程可能是:
- 在可拖动"区域点击您的内容 div
- 拖动内容,将内容保留在该 div 中
- 松开鼠标,将内容放入可放置"容器中,该容器将调整之前内容的大小以适应可放置大小
需要以下类型的事件监听器:
which needs the following types of event listeners:
- 鼠标移动
- 鼠标按下
- 动画
至少.另一种选择可能是查看 jQuery UI 源代码,看看他们是如何做到的!这将告诉您确切的操作,但您可以在必要时添加或修剪.
At the very least. Another option might be to check out the jQuery UI source, and see how they do it! Which will tell you exactly what to do but you can add to it or trim where necessary.
这篇关于没有 JQuery UI 的拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:没有 JQuery UI 的拖放


- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01