HTML事件的執行順序

 

var body = document.getElementsByTagName("body");
body = body[0];
body.addEventListener("touchstart", function(){console.log("touchstart")}, false);
body.addEventListener("touchend", function(){console.log("touchend")}, false);
body.addEventListener("touchmove", function(){console.log("touchmove")}, false);
body.addEventListener("mousedown", function(){console.log("mousedown")}, false);
body.addEventListener("mouseup", function(){console.log("mouseup")}, false);
body.addEventListener("mousemove", function(){console.log("mousemove")}, false);
body.addEventListener("click", function(){console.log("click")}, false);

點擊鼠標後的事件執行順序以下:code

相關文章
相關標籤/搜索