Chrome 中的错误行为“onselectstart”

Nov*_*ist 3 html javascript

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

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

有时需要多选几次才能调用这个bug。

Nov*_*ist 5

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

http://jsfiddle.net/JqMgE/2

没有必要使用.onselectstart.