This are my two functions, on single click it works fine, but on dblclick both functions execute, any idea? I tried using live instead of delegate but still both functions execute on dblclick
// Change Status on click
$(".todoBox").delegate("li", "click", function() {
var id = $(this).attr("id");
$.ajax({
//ajax stuff
});
return false;
});
// Double Click to Delete
$(".todoBox").delegate("li", "dblclick", function(){
var id = $(this).attr("id");
$.ajax({
//ajax stuff
});
return false;
});
From the API documentation:
I think that means you’d do your
clickaction in the timeout handler. If you get another click, and the timeout handler hasn’t happened yet, you cancel the timeout and do thedblclickcode.