Events problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Niko

    Events problems

    Hello,

    Context :

    Dom Structure

    DIV
    |->TABLE
    |->TR
    |->TD
    | |->textNode
    |
    |->TD
    | |->IMG
    |
    |->TD
    |->textNode

    I have added mouseover and mouseout events on the DIV element.

    I need thoses events only triggered when the mouse goes in and out of
    the div but actually (with IE7) they are triggered if the mouse going
    out of a Table cell to go in the adjacent cell.

    I suppose a propagation pb but I don't know how to limit the event
    attachement to the div only without any propagation to enbedded objects.

    Thanks

    Best regards

    Niko
  • Rik Wasmus

    #2
    Re: Events problems

    On Thu, 23 Oct 2008 14:50:20 +0200, Niko <niko_enlever_c a@network.fr>
    wrote:
    Hello,
    >
    Context :
    >
    Dom Structure
    >
    DIV
    |->TABLE
    |->TR
    |->TD
    | |->textNode
    |
    |->TD
    | |->IMG
    |
    |->TD
    |->textNode
    >
    I have added mouseover and mouseout events on the DIV element.
    >
    I need thoses events only triggered when the mouse goes in and out of
    the div but actually (with IE7) they are triggered if the mouse going
    out of a Table cell to go in the adjacent cell.
    >
    I suppose a propagation pb but I don't know how to limit the event
    attachement to the div only without any propagation to enbedded objects.
    Pretty well explained:

    --
    Rik

    Comment

    • Jorge

      #3
      Re: Events problems

      On Oct 23, 2:50 pm, Niko <niko_enlever.. .@network.frwro te:
      Hello,
      >
      Context :
      >
      Dom Structure
      >
      DIV
        |->TABLE
             |->TR
                 |->TD
                |   |->textNode    
                 |
                 |->TD
                |   |->IMG
                 |
                 |->TD
                    |->textNode
      >
      I have added mouseover and mouseout events on the DIV element.
      >
      I need thoses events only triggered when the mouse goes in and out of
      the div but actually (with IE7) they are triggered if the mouse going
      out of a Table cell to go in the adjacent cell.
      >
      I suppose a propagation pb but I don't know how to limit the event
      attachement to the div only without any propagation to enbedded objects.
      >
      Thanks
      >
      Best regards
      >
      Niko
      div.onmouseover = function (event) {
      var event= event || window.event;
      if (event.target !== this) { return; }
      //DoYourThingsHer e
      }

      But, ISTM that IE's 'event' object lacks a 'target' property (?) so...
      somebody else may want help you better than I.

      --
      Jorge.

      Comment

      • Justin McConnell

        #4
        Re: Events problems

        On Oct 23, 7:52 am, Jorge <jo...@jorgecha morro.comwrote:
        On Oct 23, 2:50 pm, Niko <niko_enlever.. .@network.frwro te:
        >
        >
        >
        Hello,
        >
        Context :
        >
        Dom Structure
        >
        DIV
          |->TABLE
               |->TR
                   |->TD
                  |   |->textNode    
                   |
                   |->TD
                  |   |->IMG
                   |
                   |->TD
                      |->textNode
        >
        I have added mouseover and mouseout events on the DIV element.
        >
        I need thoses events only triggered when the mouse goes in and out of
        the div but actually (with IE7) they are triggered if the mouse going
        out of a Table cell to go in the adjacent cell.
        >
        I suppose a propagation pb but I don't know how to limit the event
        attachement to the div only without any propagation to enbedded objects..
        >
        Thanks
        >
        Best regards
        >
        Niko
        >
        div.onmouseover = function (event) {
          var event= event || window.event;
          if (event.target !== this) { return; }
          //DoYourThingsHer e
        >
        }
        >
        But, ISTM that IE's 'event' object lacks a 'target' property (?) so...
        somebody else may want help you better than I.
        IE sets the srcElement property.

        div.onmouseover = function (event) {
        var event = event || window.event;
        var targ = event.target || event.srcElemen t;
        if (targ !== this) { return; }
        //DoYourThingsHer e
        }

        Comment

        Working...