鼠标事件
- 单机事件_onclick
- 双击事件_ondblclick
事件绑定的方法基本是一样的
<body>
<button>双击</button>
<script>
var btn=document.getElementsByTagName("button")[0];
var content=btn.ondblclick=function(){
alert("我的名字叫卡卡西");
}
delete(content);
</script>
</body>
鼠标移入_鼠标移出;
-
- onmouseover(“移入”)
- onmouseout(“移出”)
-
- onmouseenter(“移入”)
- onmouseleave(“移出”)
第1组与第2组的区别
是否支持事件冒泡
// onmouseenter onmouseleave 不支持事件冒泡
// onmouseover onmouseout 支持事件冒泡
鼠标按下_鼠标抬起;
- 鼠标按下_onmousedown;
- 鼠标抬起_onmouseup;
鼠标移动;
- 鼠标移动_onmousemove
差不多就这么多之后在写效果时使用;