原理:點擊事件延遲執行,雙擊觸發時,取消本該執行單擊事件的定時器this
var timeout =null; $("#Btn").on("click",function(){ clearTimeout(timeout);//中止單擊定時事件 timeout= window.setTimeout(function(){//延遲單擊事件觸發內容 console.log("this is click event"); }, 200); }); $("#Btn").on("dblclick",function(){ clearTimeout(timeout); //中止單擊定時事件 console.log("this is dblclick event"); });