event / nested objects

O

Oliver Block

Hi,

I am facing a problem with the occurance of click and dblclick events.

Given: a table that has n row and m cols, SOME of the cells contain a
div-element. ALL td-elements have an eventhandler like <td ...
ondblclick="handle_dblck('k') ...> (k is the number of the cell values: 1,
2, 3, x). ALL div-elements have an eventhandler <div ...
ondblclick="handle_clk(this)" ...>.

Events

click on td-element: none
click on div-element: 1 click-event
dblclick on td-element: 1 dblclick-event
dblclick on div-element: 2 click-events (div-element), 1 dblclick-event;

I tried to reconstruct that problem in another html page, but with no
success so far.

I anybody has an idea!?

Best Regards,

Oliver
 
O

Oliver Block

Oliver said:
Hi,

I am facing a problem with the occurance of click and dblclick events.
dblclick on div-element: 2 click-events (div-element), 1 dblclick-event;

This problem does just occur with Mozilla Browsers. It does not occur with
Microsoft Internet Explorer 6
 
V

VK

Oliver said:
This problem does just occur with Mozilla Browsers. It does not occur with
Microsoft Internet Explorer 6

AFAICT you're facing two problems at once:

1) Event bubbling: events from underlaying elements are being bubbled
up to the top through all parent containers (div > td > tr > tbody >
table > body > out)

2) Windows OS has system-level setting "detect accidental
double-clicks" activated by default. It means that it applies special
logic on doubleclick events in say IE, so some doubleclicks are treated
as single clicks and some not, depending on the nature of the clicked
element.

While the problem (1) can be fixed inside the script, the problem (2)
is out of your direct control. Alas it means that the default
doubleclick handler under Windows is rather useless for scripting
purposes. You may write your own "click-counter" to emulate doubleclick
listener in your script. Yet better IMHO simply do not count on
doubleclick event in your script so do not use it in your solutions.

If you have TweakUI installed, you can disable "detect accidental
double-clicks" option on IE tab to see the difference. Alternatively
you can directly change Windows registr, see for instance
<http://www.winguides.com/registry/display.php/965/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top