3

有一个必须用“移动”光标移动的可拖动元素。当我移动元素时,光标将变得像选择一样。我尝试.onselectstart = function(e) { return false }在“mousedown”和.onselectstart = null“mouseup”上使用。它运作良好。但它在页面上的任何选择后停止工作。我只在 Google Chrome 和 Maxthon 中观察到它。

所以,看看http://jsfiddle.net/JqMgE/1/

有时需要选择几次才能调用此错误。

4

1 回答 1

5

event.preventDefault() onmousedown我通过使用and解决了这个问题onmousemove

http://jsfiddle.net/JqMgE/2

没有必要使用.onselectstart.

于 2012-10-20T20:42:10.090 回答