拖放的最佳轻量级解决方案是什么?
我非常喜欢并使用 jQuery,但我希望为特殊项目找到替代解决方案。
我正在创建一个书签,它将与我的应用程序交互,以允许用户更快地输入信息。目前我的应用程序中最痛苦的事情之一是上传图像。用户(可以理解)讨厌以有组织的方式将图像下载到计算机,然后将其上传到应用程序的过程。
我希望小书签能够加载一个小 div 覆盖层,其中包含几个小控件,其中一个允许用户将图像从当前页面拖放到控件中。然后,脚本会收集这些 img 标签的 URI,并将它们与表单一起提交到应用程序,然后服务器会自动将它们下载到应用程序中。
因此,对于此任务,每次单击小书签时将 jQuery 和 jQuery UI 加载到页面中似乎是一种非常严厉的方法。
任何人都可以推荐一个漂亮的、轻量级的 Javascript 工具包,它只处理拖放功能吗?
我很高兴阅读有关新的 DragDealer 工具,看起来棒极了,今天就在 ajaxian 上,但它似乎只处理拖动而不是“放置”(即,不是目标)
I love and use jQuery quite a lot, but I am hoping to find an alternate solution for a special project.
I am creating a bookmarklet which will interface with my application to allow users to enter information much quicker. One of the greatest pains in my application at the moment is uploading images. Users (understandly) hate the process of downloading images to their computers in an organized fashion, and then uploading them to the app.
What I would love the bookmarklet to do is load in a small div overlay with a couple small controls in it, including one which would allow the user to drag and drop images from the current page into the control. The script would then collect the URI's of those img tags and submit them along with the form to the app, and then they would automatically be downloaded by the server into the app.
So, for this task, loading jQuery and jQuery UI into the page every time you click the bookmarklet seems like a very heavy-handed approach.
Can anyone recommend a nice, light-weight, Javascript toolkit that handles drag and drop functionality and nothing else?
I was excited to read about the new DragDealer tool, which looks awesome, just today on ajaxian but it seems that it is built to handle only dragging and not "dropping" (i.e., not targets)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为库可能不是最好的解决方案,只需尝试搜索一个为您提供此功能的函数/独立插件/小部件,例如
I think a library might not be the best solution and just try searching for a function/stand alone plugin/widget that just delivers this functionality for you such as
REDIPS.drag JavaScript 库仅涵盖拖放(表格内容)。实际上,HTML 表格用作布局,DIV 元素可以跨表格单元格移动。当拖动的元素位于表格单元格上方时,表格单元格将突出显示 - 如果启用的话。经过最小化和 GZIP 压缩,库小于 10Kb。以下是演示页面的链接:
http://www.redips。 net/javascript/drag-and-drop-table-content/
REDIPS.drag JavaScript library covers only drag and drop (table content). Actually HTML table is used as layout and DIV elements can be moved across table cells. In a moment when dragged element is over table cell, table cell will be highlighted - if is enabled. Minimized and GZIPed, library is less then 10Kb. Here is link to the demo page:
http://www.redips.net/javascript/drag-and-drop-table-content/
我认为您可能喜欢的最受欢迎的之一是 script.aculo.us,位于
http://script.aculo .us/
I think one of the most popular ones you might like would be script.aculo.us found at
http://script.aculo.us/