[Javascript] Want to trap both click and double-click

Miles Thompson miles at allnovascotia.com
Sat Dec 16 12:23:46 CST 2006


For turning advertisements on and off in my client's web site, and setting 
whether they appear on the left, on the right or not at all I would like to 
use the following protocol

onclick -  function to check value, if "None" set it to "Left", else set it 
to "Left"

ondblclick - function to set value for the date to "Right"

The calendar is a two dimensional array of dates, first dimension is date 
value, second dimension holds value associated with that date.
I plan that each displayed date will be an anchor with its ID being the 
date value. e.g. <A  href=(the javascript func) id=arrCalendar[1][4] > 
arrCalendar[1][4]</A> displays the date for the second week, fifth day of 
the week.

My problems is getting reliable detection of the single click or the 
double-click - anything I've tried gives me one or the other. I really 
don't want to pop up a form to make the setting changes. My users prefer to 
click directly on the date to change it.

(Date colour changes and database update will be handled asynchonously)

Does anyone have any suggestions? They would be most welcome.

Thanks - Miles Thompson


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.21/589 - Release Date: 12/15/2006





More information about the Javascript mailing list