event-button:鼠标按钮
2016-06-06 20:35
218 查看
button | 返回当事件被触发时,哪个鼠标按钮被点击。 |
定义和用法
button 事件属性可返回一个整数,指示当事件被触发时哪个鼠标按键被点击。
语法
event.button=0|1|2
参数 | 描述 |
---|---|
0 | 规定鼠标左键。 |
1 | 规定鼠标中键。 |
2 | 规定鼠标右键。 |
if(e.button == 0){
console.log("left")
}else if(e.button == 1){
console.log("midden")
}else if(e.button == 2){
console.log("right")
}
});
相关文章推荐
- POJ 1456 Supermarket【贪心+并查集】
- 【Leetcode】Reverse Integer
- Going Deeper with Convolutions
- 红感叹号
- 评分卡模型剖析之一(woe、IV、ROC、信息熵)
- TCP\UDP
- 【Leetcode】String to Integer (atoi)
- 逻辑回归(Logistic Regression)
- OkHttp 3.0之后版本GET、POST请求以及POST上传文件的示例代码
- 如何远程访问svn 服务器
- PopupWindow+ListView
- 【Leetcode】Length of Last Word
- listView
- 垃圾收集器
- malloc、zalloc、calloc
- .NET-Dictionary索引重载 赋值时允许Key不存在
- SpringEmail with Velocity template date and number formatting
- 第十三周上机实践项目:阅读、修改和运行关于交通工具类的程序(2)
- radioButton的简单使用
- 根据身份证算出地址