...

View Full Version : onClick vs onDblClick (hopefully this is the correct forum to post in)



rlemon
10-28-2005, 09:41 PM
say i have the following element on my site




<img src="img.jpg" onClick="dothisfunction()" onDblClick="differentfunction()" />



Whenever i click on the image i receive the onClick function, this is regardless of the number of click and the speed in which i do it.

is there a way to have an element do something different between single click and double click?

*note, the double click function is called when i double click IF there is no single click attribute on the element.

felgall
10-28-2005, 10:23 PM
In Internet Explorer double clicking will trigger the following events:

mousedown
mouseup
click
mousedown
mouseup
click
dblclick

Other browsers will trigger the same except for the last event "dblclick" which is an IE proprietary event.

You will need to write your code in such a way as to cater for this series of events.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum