存在必须使用“移动”光标移动的可拖动元素。当我移动元素时,光标将变得像选择一样。我尝试在“mousedown”上使用 .onselectstart = function(e) { return false }
并在“mouseup”上使用 .onselectstart = null
。它运作良好。但是在页面上进行任何选择后它都会停止工作。我仅在 Google Chrome 和 Maxthon 中观察到它。
所以,看看http://jsfiddle.net/JqMgE/1/
有时需要select几次才能调用这个bug。
最佳答案
我使用 event.preventDefault()
onmousedown
和 onmousemove
解决了这个问题。
不需要使用.onselectstart
。
关于javascript - Chrome 中的错误行为 'onselectstart',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12992172/