var timer = '';$('.smallBox').on('click', '.smallBoxCon li', function () { var that = this; // setTimeout 计时器(延时器) clearTimeout(timer);//清除第一次的单击事件 //500毫秒之后运行点击事件 timer = setTimeout(function () { var url = $(that).attr('url') }, 500); }) $('.smallBox').on('dblclick', '.smallBoxCon li', function () { var that = this; jsobj.type = "dbclick"; clearTimeout(timer);//清除第二次的单击事件 })复制代码