I've found a workarround to make the native dnd api also work in IE with elements other than links and images. Add a onmousemove handler to the draggable container and call the native IE function element.dragDrop(), when the button is pressed:
function handleDragMouseMove(e) {
var target = e.target;
if (window.event.button === 1) {
target.dragDrop();
}
}
var container = document.getElementById('widget');
if (container.dragDrop) {
$(container).bind('mousemove', handleDragMouseMove);
}
// todo: add dragstart, dragover,... event handlers
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…