一、IE
左键是 window.event.button = 1
右键是 window.event.button = 2
中键是 window.event.button = 4
没有按键动作window.event.button = 0
二、Firefox
左键是 event.button = 0
右键是 event.button = 2
中键是 event.button = 1
没有按键动作 event.button = 0
三、Opera 7.23/7.54
鼠标左键是 window.event.button = 1
没有按键动作 window.event.button = 1
右键和中键无法获取
四、Opera 7.60/8.0
鼠标左键是 window.event.button = 0
没有按键动作 window.event.button = 0
右键和中键无法获取
另外:屏蔽右键的是window.event.button = 3
Window.event对象代表事件的状态,例如触发event对象的元素、鼠标的位置及状态、按下的键等等。
Window.event对象只在事件发生的过程中才有效。
Window.event的某些属性只对特定的事件有意义。比如,fromElement 和 toElement 属性只对 onmouseover 和 onmouseout 事件有意义。
如果事件触发后,鼠标移出窗口外,则返回的值为 -1 ,这是个只读属性。这意味着,你只能通过它来得到鼠标的当前位置,却不能用它来更改鼠标的位置。
Event对象的属性有:
altKey, button, cancelBubble, clientX, clientY, ctrlKey, fromElement, keyCode, offsetX, offsetY, propertyName, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y