在Chrome(Chromium 45)中,可拖動元素的幻影圖像呈現在白色背景上。我如何強制它在透明背景上渲染鬼像,就像Firefox一樣?透明背景用於HTML5拖放幻影
實施例:http://jsfiddle.net/c8p24q6y/
我有一個黑暗的背景圖像(由黑色表示)。當您在Chrome中拖動列表項目時,幻影圖像具有醜陋的白色背景。在Firefox中,幻影圖像將具有透明背景。
<html>
<head>
<style>
body{
background-color:black;
}
ul { list-style-type:none; }
li *{
display:inline-block;
border-radius:10px;
width:100px;
height:23px;
margin-right:8px;
cursor:move;
}
li :first-child{ background-color:red; }
li :last-child{ background-color:blue; }
</style>
<script>
window.onload = function(){
var dc = document.getElementById("drag_cont");
dc.ondragstart = function(e){
e.dataTransfer.setData("text/plain", "testing");
};
}
</script>
</head>
<body>
<ul id="drag_cont">
<li draggable="true">
<div></div><div></div>
</li>
<li draggable="true">
<div></div><div></div>
</li>
</ul>
</body>
</html>
你在什麼操作系統上?我剛剛在Mac上進行了Chrome 46測試,一切正常 - https://jsbin.com/sivaquk/latest - 可能是45問題,操作系統問題或任何問題。 – Kinlan
我在Linux(Xubuntu)上。我只是嘗試在Windows上,它工作正常。所以,我想我沒有什麼可以做的。 – Azmisov
提交了一個錯誤報告:https://code.google.com/p/chromium/issues/detail?id=550999 – Azmisov