Is there a way to bind an event handler to a double click with jQuery instead of single click?
+3
A:
Sure, you can use the $.dblclick()
method:
$(".foo").dblclick(function(){
// do something
});
Jonathan Sampson
2010-02-18 04:22:11
+4
A:
Sure, jQuery has a dblclick()
event:
$("div").dblclick(function() {
alert("double clicked");
});
One warning, from the docs:
It is inadvisable to bind handlers to both the
click
anddblclick
events for the same element
cletus
2010-02-18 04:22:20
Who downvoted this?
cletus
2010-02-18 04:28:30