1. Sample code
// 单击进行延迟,若双击要清除单击延迟,实现双击操作
var timeId;
function singclick() {
clearTimeout(timeId);
timeId = setTimeout(function () {
console.log("单击");
}, 250);
}
function dblclick() {
clearTimeout(timeId);
console.log("双击");
}
2. Matters needing attention
Double click event is dblclick , not dbclick