event / nested objects

Discussion in 'Javascript' started by Oliver Block, Jun 2, 2006.

  1. Oliver Block

    Oliver Block Guest

    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
    Oliver Block, Jun 2, 2006
    #1
    1. Advertising

  2. Oliver Block

    Oliver Block Guest

    Update

    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
    Oliver Block, Jun 3, 2006
    #2
    1. Advertising

  3. Oliver Block

    VK Guest

    Re: Update

    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/>
    VK, Jun 3, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Russ Perry Jr
    Replies:
    2
    Views:
    4,129
    Russ Perry Jr
    Aug 20, 2004
  2. Chad E. Dollins
    Replies:
    3
    Views:
    654
    Kai-Uwe Bux
    Nov 8, 2005
  3. request@no_spam.com
    Replies:
    5
    Views:
    422
  4. 7stud
    Replies:
    11
    Views:
    689
    Dennis Lee Bieber
    Mar 20, 2007
  5. Ultrus
    Replies:
    3
    Views:
    377
    Stefan Behnel
    Jul 9, 2007
Loading...

Share This Page