Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > event / nested objects

Reply
Thread Tools

event / nested objects

 
 
Oliver Block
Guest
Posts: n/a
 
      06-02-2006
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

 
Reply With Quote
 
 
 
 
Oliver Block
Guest
Posts: n/a
 
      06-02-2006
Oliver Block wrote:
> 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
 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      06-03-2006
Oliver Block wrote:
> > 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


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/>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dealing with nested xml within nested xml within...... Ultrus Python 3 07-09-2007 09:00 PM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
Is nested class automatically friend of class that it is nested in? request@no_spam.com C++ 5 09-25-2006 08:31 AM
Nested Vector Nester Classes are Nested in my Brain Chad E. Dollins C++ 3 11-08-2005 04:46 AM
Nested iterators (well, not nested exactly...) Russ Perry Jr Java 2 08-20-2004 06:51 PM



Advertisments