// clicks var Times = 0 ; function ClickEvent (param) { Times ++ ; the setTimeout ( function () { IF (1 == Times) { // console.log ( "click"); clickEvent1 (param); } the else IF (2 == Times) { // the console.log ( "double-clicking"); clickEvent2 (param); } Time = 0 ; }, 300 ); }