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 的拖放
基础教程推荐
- 检查 HTML5 拖放文件类型 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
