0

I have 2 events for an element:

$('#my-element').click(function() {
    alert("Hello world!");
});

$('#my-element').dblclick(function() {
    alert("Hello world - double clicked!");
});

Both events are fired when the user double clicks the element.

How can I prevent the click element being fired when the user double clicks?

Jared
  • 2,978
  • 4
  • 26
  • 45
  • I don't get how double click will fire when you have single click event too – Mr. Alien May 20 '14 at 08:18
  • 2
    _It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable._ – Royi Namir May 20 '14 at 08:19

0 Answers0