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

Miles Thompson miles at allnovascotia.com
Mon Dec 18 14:49:25 CST 2006


You're right Mike - I was just hoping to give the user some direct 
interaction, without dealing with a popup. Radio buttons in the calendar 
would make it pretty bulky.

Cheers - Miles

At 10:16 AM 12/18/2006, Mike Dougherty wrote:

>Why not just use the click method to cycle through none|left|right ?
>
>Due to the way dblclick is handled (or not) I just don't use it at all
>
>If you really want a dblclick, I suggest writing your click method to 
>detect if it has fired within the last X milliseconds- something like:
>click fired - set a timeout to call the single-click behavior
>click fired again - if there is a waiting timeout, cancel it and call the 
>2xclick behavior
>
>hmm... instead of all this fancy behavior, what about using some radio 
>buttons? (or select?)
>
>
>On Sat, 16 Dec 2006 14:23:46 -0400
>  Miles Thompson <miles at allnovascotia.com> wrote:
>>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
>>
>>_______________________________________________
>>Javascript mailing list
>>Javascript at LaTech.edu
>>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript


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





More information about the Javascript mailing list