These are the events I am hooking handlers to: onmouseclick, onmousedblclick and onselectstart.
So: only selection through doublecklick.
I thought it would work by something like this:
But it seems as the order of the event handlers being called is weird (to me), namely: 1. onclick, 2. onselectstart, 3. ondblclick. So I don't know how to tell the onselectstart handler that the selection is triggered by a dblclick. How do I achivie this???
edit: changed keywords to onclic_k... due to forum filter. [ September 13, 2007: Message edited by: seb petterson ]
posted 13 years ago
I think I could achieve this if I can get the object that was clicked (the table cell, or the span element that lays in it and which contains the double clicked text). I have the x y coordinates from the window.event.[x|y] ...anyone knows how to get the object?
Standards-compliant browsers will pass the event instance as the parameter to the handler. IE sets it as a property on window. The above idiom handles both cases. For real browsers, the target element will be identified as the target property in the event nstance, for IE, srcElement.
Or, you could do what most experienced developers do and employ a robust library such as jQuery or Prototype to handle all the browser differences for you.