問題描述
我非常喜歡并使用 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
這篇關于拖放的最佳輕量級解決方案是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!