Is it possible to differentiate single click and double click using javascript/jquery?
Ie: If a user single clicks an element Action A takes place and if they double click the element Action B takes place?
Thanks.
whoisgregg
7:42 pm on Jul 8, 2009 (gmt 0)
Hi almo!
You can use the ondblclick event, just be careful with defining both a regular single onclick and an ondblclick event as I believe the onclick event also fires whenever the ondblclick fires.
almo136
8:16 pm on Jul 8, 2009 (gmt 0)
Thanks. I used the ondblclick method and it works.
You are right about the single click still firing. Is it possible to prevet this? This is what i've got so far:
I don't know of a way to block the single click event. In my brief research on the subject it seemed like a problem that no one had solved -- at least not in a portable way.