根据HTML5 Doctor的说法,如果没有JS的帮助,这将无法在Firefox中运行。 HTML 5规范说,它应该像添加以下属性到所讨论元素的标记一样简单:
draggable="true"
但是,这对于Safari或Firefox完全不起作用。对于Safari,您需要将以下样式添加到元素中:
[draggable=true] { -khtml-user-drag: element; }
这将在Safari中开始工作,并且在拖动它时将使用dataTransfer对象设置默认的空值。但是,除非您手动设置一些数据才能使用它,否则Firefox不会允许您拖动该元素。为了解决这个问题,我们需要一个dragstart事件处理程序,并且我们会给它一些数据来拖动:
var dragItems = document.querySelectorAll('[draggable=true]'); for (var i = 0; i < dragItems.length; i++) { addEvent(dragItems[i], 'dragstart', function (event) { // store the ID of the element, and collect it on the drop later on event.dataTransfer.setData('Text', this.id); }); }
... 展开详请
这个帖子的答案是非常有用的,节省了大量的时间。但是,我发现在使用时FontAwesome 4.50,我不得不添加一个woff2扩展类型的附加配置,如下所示,其他woff2类型的请求在Chrome的开发工具中给出了一个404错误,在Console> Errors下。
根据S.Serp的评论,下面的配置应该放在<system.webServer>标签内。
<staticContent>
<remove fileExtension=".woff" />
<!-- In case IIS already has this mime type -->
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2" />
<!-- In case IIS already has this mime type -->
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
</staticContent>... 展开详请