tags:

views:

144

answers:

2

Whenever a mousedown or mouseup handler is attached to an element the dblclick cannot be attached (won't work if attached), though this seems fair enough is there any way to reinstate a dblclick functionality without rewriting it from scratch (sigh...) Or am I missing something about events propagation?

+1  A: 

It works - place this code in Firebug on this very page and you'll see it working (try double clicking on the text of your question):

($('.post-text')
    .mousedown(function () { console.log('down'); })
    .mouseup(function () { console.log('up'); })
    .dblclick(function () { console.log('dbclick'); }));

Don't have Firebug? Go grab it, I'll wait!

Emil Ivanov
Thanks Emil,I was in Opera 10.10, a similar (homemade) debugging code works but hapazardly: scrollframe .mousedown(function (evt) { eventlog(evt, ' ', false); }) .mouseup(function (evt) { eventlog(evt, ' ', false); }) .dblclick(unscroll);It seems there are doubleclick problems with Opera, plus the context is a bit more complicated the non responsive div area is scrollable and also contains draggable objects.Anyway that was a stupid question, since I need to defer the action on the mousedown I will test for a still running timeout on the second mousedown.(comment limit sucks)
Favonius
I DO MEAN the comment handling sucks!<br>Is this StackIverflow, really?
Favonius
+1  A: 

Your mousedown and mouseup cannot:

  1. do e.stopPropagate etc.
  2. return false

and it should work if Your code doesn't have a conflict between them methods

naugtur