Double click on <a> tag

Hi Gurus,

Is it possible to write a double click even in <a> tag. I wrote two events(click and double click) and when i double clicked the tag it is going to click event.

is it possible to fire double clickevent in <a> tag.

Thanks

Karthik
mani_karthikAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
idtConnect With a Mentor Commented:
This really is a question for the HTML or JavaScript area, however,

no, there is no double click event.

events for <A..

onMouseOver   ~fires when the mouse moves over the link
onMouseOut    ~fires as the mouse leaves the area
onClick           ~mouse left click

(right click is trapped by browser)

having said that, you could write your own double click event.

idea..

set somevar to 1 upon click

set a timeout to fire in ..say 200ms

then..
if another click occurs before the timeout event,
and somevar already equal 1, cancel the timeout event and do your doubleclick code

if the timeout fires before another click do your single click code


-iDT
0
All Courses

From novice to tech pro — start learning today.