拖放 *FROM* 浏览器?

Drag and Drop *FROM* a browser?(拖放 *FROM* 浏览器?)
本文介绍了拖放 *FROM* 浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

将项目拖入浏览器已有很好的文档记录,而 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* 浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

相关文档推荐

quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
How to use coffeescript in developing web-sites?(如何在开发网站时使用coffeescript?)
Expose a javascript api with coffeescript(使用 coffeescript 公开一个 javascript api)