> but i think that there should be a click or dblClick event > (depending on the doubleclick delay > parameter) but *never* both. if i doubleclock to slow, the > this results in two clicks, but if i click fast enough then > this shold trigger a doubleClick event and no single click.
The only way for this to work would be if click events were automatically delayed by the double-click interval. GUI designers tried this 20 years ago and it didn't work then any better than it would now. It makes the application feel too unresponsive. (Sorry!) > does anyone know a system where a dblClick produces two > additional click events? i don't think so. So as to simultate > common behavior click and dblClick should not happen together. Are you saying that a double-click is giving you *two* click events plus the dblclick event? That shouldn't happen. You should get one click and one dblclick. Can you post a sample page showing this behavior? > > You can avoid doing the click action by using setTimeout in the > > click() handler for say 400ms, and only execute the click action > > if the timer expires. Your double-click handler should cancel > > the timer and perform the double-click action. You cannot make > > the click timeout shorter than the double-click time, which in > > Windows is configurable by the user. So don't try to make the > > click timeout short. Don't do this! You don't know what the double-click interval is, so there is no way you can do it reliably. Instead, rethink your design. Proper GUI behavior is that if you handle double clicks, then whatever action you take on a single click should not interfere with the double-click action. The classic example is in the Mac Finder and Windows Explorer with default settings: A single click selects, and a double click opens. Selecting the object on the single click does not interfere with opening it on the double click. If you *must* have a click event cause a destructive action, then you'll need to do your own double-click processing completely. Don't use the dblclick event at all; instead watch the time and mouse location of click events to decide what is a double click. -Mike _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
