拖放的最佳轻量级解决方案是什么?

What are the best light-weight solutions for Drag and Drop?(拖放的最佳轻量级解决方案是什么?)
本文介绍了拖放的最佳轻量级解决方案是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我非常喜欢并使用 jQuery,但我希望为特殊项目找到替代解决方案.

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.

我希望小书签做的是加载一个小的 div 叠加层,其中包含几个小控件,包括一个允许用户将图像从当前页面拖放到控件中的控件.然后,该脚本会收集这些 img 标签的 URI,并将它们与表单一起提交给应用程序,然后服务器会自动将它们下载到应用程序中.

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.

因此,对于这项任务,每次单击书签时都将 jQuery 和 jQuery UI 加载到页面中似乎是一种非常笨拙的方法.

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.

谁能推荐一个不错的、轻量级的 Javascript 工具包,只处理拖放功能而不是其他功能?

我很高兴看到新的 DragDealer 工具,它看起来很棒,就在今天ajaxian,但它似乎只处理拖动而不是放下"(即,不是目标)

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)

推荐答案

我认为库可能不是最好的解决方案,只是尝试搜索一个功能/独立插件/小部件,它只是为您提供此功能,例如

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

  • http://www.webreference.com/programming/javascript/mk/column2/
  • http://luke.breuer.com/tutorial/javascript-drag-and-drop-tutorial.aspx
  • http://tool-man.org/examples/dragging.html

这篇关于拖放的最佳轻量级解决方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
Ordinals in words javascript(javascript中的序数)
getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)