tags:

views:

79

answers:

2

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
+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 and dblclick events for the same element

cletus
Who downvoted this?
cletus