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

Mike Dougherty mdougherty at pbp.com
Tue Dec 19 08:07:35 CST 2006


[iirc] the last time I looked at it, the dblclick method was an IE extension and is not supported 
by Fx.  Even IE does it... sub-optimally - by firing the click method on each of the clicks 
comprising the double-click.  So if you don't have any click method, you can easily register the 
dblclick.  If you are using the more intuitive click for something, then want to use dblclick in 
addition you will end up firing two single clicks then a dblclick.  in a select/activate scenario, 
most people will end up causeing a "select"  then a "select, select, activate" - I know js is 
fast, but that seems like a lot of redundant code.

another interface option might be to use the click to select, then add the interface controls to 
the selected box.  have a small toggle button on either side of the control that is being modified 
such that if the user wants "right" alignment, they turn on the right toggle.  Switch to "left" 
implicitly turns off the "right" alignment.  Clicking either "On" option turns it off to restore 
the default "none" state.  Cluttering a calendar with all these extra buttons would look terrible, 
but displaying these extra controls for only the current date in a calendar would also provide 
visual indicator of the current day.

fwiw - if you do go this route, try to build a library so you can reuse this widget.  Then if 
you're feeling generous, post the library somewhere so we can share. :)

On Mon, 18 Dec 2006 17:01:46 -0800
  Paul Novitski <paul at juniperwebcraft.com> wrote:
> 
> I'm interested in the original question.  Is the ondblclick event not well-supported 
>cross-browser?



More information about the Javascript mailing list