一些常用的鼠标事件

var one = document.getElementById("one");
var two = document.getElementById("two");
var three = document.getElementById("three");
var four = document.getElementById("four");
var five = document.getElementById("five");
var six = document.getElementById("six");
var seven = document.getElementById("seven");
var eight = document.getElementById("eight");
var nine = document.getElementById("nine");
var test = function(){
console.log("点击触发");
}

one.addEventListener("click",test);
two.addEventListener("dblclick",test);
three.addEventListener("mousedown",test);
four.addEventListener("mouseout",test);
five.addEventListener("mouseover",test);
six.addEventListener("mouseup",test);
seven.addEventListener("mousemove",test);
eight.addEventListener("mouseenter",test);
nine.addEventListener("mouseleave",test);

这是一些常用的鼠标事件的书写格式。。。
posted @ 2017-03-26 22:35  ATF七夜  阅读(358)  评论(0编辑  收藏  举报