我正在使用 "draggable" 属性,并发现不同的浏览器在拖动元素时呈现的方式不一样。具体来说,有时背景颜色取自父元素(例如Chromium 33),有时使用白色(例如Firefox 28)。
<div style="background-color: #79a; padding: 4px;">
<div style="border-radius: 12px; padding: 12px; background-color: #ead;" draggable='true' ondragstart="event.dataTransfer.setData('text/plain', 'This text may be dragged')">
<p>Some content here that should have clean rounded corners while being dragged</p>
</div>
</div>
请参见上面的链接。
有没有一种方法(最好使用CSS)来缓解这个问题?
draggable
属性不是jQueryUI的属性,而是HTML5规范的一部分 - 支持它的浏览器可以本地拖动几乎任何元素:完全不需要jQuery。这个小例子是有效的。 - Brian North