當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
[转]JS中判断鼠标按键判断
生活随笔
收集整理的這篇文章主要介紹了
[转]JS中判断鼠标按键判断
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
JS中判斷鼠標按鍵的問題。
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
轉載于:https://www.cnblogs.com/aooyu/archive/2009/12/14/1623967.html
總結
以上是生活随笔為你收集整理的[转]JS中判断鼠标按键判断的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: windchill开发之创建对象
- 下一篇: WCF热带鱼书学习手记 - Servic