不是oEvent.preventDefault(); 在GC工作?触发onmove事件时,我需要阻止选择文本.
编辑:事实证明这很容易......
function disableSelection() {
document.onselectstart = function() {return false;} // ie
document.onmousedown = function() {return false;} // others
}
function enableSelection() {
document.onselectstart = null; // ie
document.onmousedown = null; // others
}
Run Code Online (Sandbox Code Playgroud)
之后,在移动事件中没有触发文本选择(即在选择事件上触发 - 即 - 确实就是!)