Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

double click question

Status
Not open for further replies.

Vigita

Programmer
Joined
Feb 2, 2006
Messages
1
Location
RO
Hi,

here is my problem : i have some banners which users now click on in order to get points.The thing is i need the users to DOUBLE-CLICK on the banners.

So my question is if it exists a way to force the users to double-click instead of just simply clicking.I also tried to put an alert on the onClick event and then have the onDblClick event but the alert is triggered no matter if the user clicks or double-clicks.

Any ideas are welcome :)
 
What browser are you using? If you're clicking fast enough to fire a double-click event, but you're getting single-click behavior, then I'm thinking that your browser doesn't support double-clicks. You need to program a work-around. Meanwhile, that same work-around will not work for browsers that DO support double-clicks, so you need to prepare for both eventualities.

For creating a double-click-LIKE event, using single-clicks, set a flag at the onclick event and start a timer. If another click comes in before the timer is out (say 1/2-second), then call it a double-click and behave accordingly. Otherwise, reset the flag and return to "ready state".

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top