//清除鼠标右键默认事件
document.oncontextmenu = function(e){
e.preventDefault();
};
window.onmousedown = function(e){
if( e.button === 2 ){
console.log("右键");
}else if( e.button == 0 ){
console.log("左键");
}else if( e.button === 1 ){
alert("中建");
}
}
/*
window.addEventListener('mousedown',function(e){
if( e.button === 2 ){
console.log("右键");
}else if( e.button == 0 ){
console.log("左键");
}else if( e.button === 1 ){
alert("中建");
}
});
*/