問題描述
將項目拖入瀏覽器已有很好的文檔記錄,而 HTML5 使這更容易.
Dragging items into a browser is pretty well documented, and HTML5 makes this easier.
但是,我想知道是否以及如何將'n' drop 拖出瀏覽器.
However, I'm wondering if and how it's possible to drag 'n' drop out of a browser.
在這種情況下,您將擁有一個用戶可以點擊的網頁元素(例如錨點)&將瀏覽器的 OUT 拖到放置目標上,瀏覽器會將鏈接對象(例如,href'd 文件)直接發送到放置目標,而不是開始通常的下載.
In this scenario, you'd have a webpage element (eg. an anchor) that the user would click & drag OUT of the browser onto a drop target, and the browser would send the linked object (eg. an href'd file) directly to the drop target instead of starting the usual download.
有誰知道這是否可行?
推薦答案
您正在嘗試做的事情可以在這里找到:https://ryanseddon.com/html5/gmail-dragout/.
The very thing you are trying to do can be found here: https://ryanseddon.com/html5/gmail-dragout/.
這是一個關于如何將錨標記拖到桌面的說明,文件將在那里下載.(或者將錨標簽拖到另一個應用程序上,操作系統會適當處理.)
This is an explanation for how to drag an anchor tag to the desktop, and the file will be downloaded there. (Or drag the anchor tag onto another application, and the OS will treat it appropriately.)
我還沒有想通的是,如何通過 HTML5 拖放多個鏈接(而不是一次只有一個),而不必求助于 jquery 之類的外部資源庫.
What I haven't figured out yet, is how to drag-and-drop multiple links (instead of only one at a time) via HTML5, without having to resort to an external resource library like jquery.
這篇關于拖放 *FROM* 瀏覽器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!