Problem: onmouseout being signaled w/o leaving the element!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • delerious@no.spam.com

    Problem: onmouseout being signaled w/o leaving the element!

    I have a DIV that contains some anchors arranged vertically. On the DIV
    element I have an onmouseout event handler. If I move the mouse over one of
    the anchors, and then move it to another anchor (while remaining inside the
    DIV), the onmouseout event handler gets triggered even though the mouse never
    went outside the DIV. This happens in IE, Opera, and Mozilla.

    You can see this problem for yourself here:


    Does anyone know why this is happening?

  • rf

    #2
    Re: Problem: onmouseout being signaled w/o leaving the element!


    <delerious@no.s pam.com> wrote in message
    news:3fd6dd95.1 80015980@news.m d.comcast.gigan ews.com...[color=blue]
    > I have a DIV that contains some anchors arranged vertically. On the DIV
    > element I have an onmouseout event handler. If I move the mouse over one[/color]
    of[color=blue]
    > the anchors, and then move it to another anchor (while remaining inside[/color]
    the[color=blue]
    > DIV), the onmouseout event handler gets triggered even though the mouse[/color]
    never[color=blue]
    > went outside the DIV. This happens in IE, Opera, and Mozilla.
    >
    > You can see this problem for yourself here:
    > http://home.comcast.net/~delerious1/index4.html
    >
    > Does anyone know why this is happening?[/color]


    My reading of the spec at
    http://www.w3.org/TR/html4/interact/....html#h-18.2.3 is that the
    browser is behaving as expected. The mouse is moving "away" from the
    element, that is it is moving into the nested <a> element.

    What you are probably thinking of is the IE proprietry onMouseLeave event.
    This only occurs when the mouse leaves the boundary of the element.

    What are you trying to achieve anyway that can't be done with CSS?

    Cheers
    Richard.


    Comment

    • delerious@no.spam.com

      #3
      Re: Problem: onmouseout being signaled w/o leaving the element!

      On Wed, 10 Dec 2003 13:04:00 GMT, "rf" <making.it.up@t he.time> wrote:[color=blue]
      >My reading of the spec at
      >http://www.w3.org/TR/html4/interact/....html#h-18.2.3 is that the
      >browser is behaving as expected. The mouse is moving "away" from the
      >element, that is it is moving into the nested <a> element.
      >
      >What you are probably thinking of is the IE proprietry onMouseLeave event.
      >This only occurs when the mouse leaves the boundary of the element.
      >
      >What are you trying to achieve anyway that can't be done with CSS?[/color]

      I want the entire navigation menu (the DIV element) to disappear when the
      mouse leaves it. I will need to use Javascript to set the visibility to
      hidden.

      It appears the problem is happening because the onmouseout event on the anchor
      is bubbling up to the DIV. I should be able to use window.event.ca ncelBubble
      (for IE) or event.stopPropa gation() (for Opera/Mozilla) to solve this problem.

      Comment

      • rf

        #4
        Re: Problem: onmouseout being signaled w/o leaving the element!


        <delerious@no.s pam.com> wrote in message
        news:3fd79a58.2 28345923@news.m d.comcast.gigan ews.com...[color=blue]
        > On Wed, 10 Dec 2003 13:04:00 GMT, "rf" <making.it.up@t he.time> wrote:[color=green]
        > >My reading of the spec at
        > >http://www.w3.org/TR/html4/interact/....html#h-18.2.3 is that the
        > >browser is behaving as expected. The mouse is moving "away" from the
        > >element, that is it is moving into the nested <a> element.
        > >
        > >What you are probably thinking of is the IE proprietry onMouseLeave[/color][/color]
        event.[color=blue][color=green]
        > >This only occurs when the mouse leaves the boundary of the element.
        > >
        > >What are you trying to achieve anyway that can't be done with CSS?[/color]
        >
        > I want the entire navigation menu (the DIV element) to disappear when the
        > mouse leaves it. I will need to use Javascript to set the visibility to
        > hidden.[/color]

        Wouldn't that be a silly thing to do? How would a user find the navigation
        in the first place, random mouse sweeps?

        Mystery meat navigation.

        Cheers
        Richard.


        Comment

        • delerious@no.spam.com

          #5
          Re: Problem: onmouseout being signaled w/o leaving the element!

          On Wed, 10 Dec 2003 23:41:50 GMT, "rf" <making.it.up@t he.time> wrote:[color=blue]
          >Wouldn't that be a silly thing to do? How would a user find the navigation
          >in the first place, random mouse sweeps?
          >
          >Mystery meat navigation.[/color]

          LOL. No that page doesn't contain my actual menu. It just contains simple
          code that illustrates a problem. My actual menu has a main menu that never
          disappears. When a user moves the mouse over one of the links in the main
          menu, a submenu appears (javascript sets visibility to visible). Then the
          submenu should disappear (javascript sets visibility to hidden) when the mouse
          moves out of the submenu DIV.

          Comment

          • rf

            #6
            Re: Problem: onmouseout being signaled w/o leaving the element!


            <delerious@no.s pam.com> wrote in message
            news:3fd7b8ef.2 36177912@news.m d.comcast.gigan ews.com...[color=blue]
            > On Wed, 10 Dec 2003 23:41:50 GMT, "rf" <making.it.up@t he.time> wrote:[color=green]
            > >Wouldn't that be a silly thing to do? How would a user find the[/color][/color]
            navigation[color=blue][color=green]
            > >in the first place, random mouse sweeps?
            > >
            > >Mystery meat navigation.[/color]
            >
            > LOL. No that page doesn't contain my actual menu. It just contains[/color]
            simple[color=blue]
            > code that illustrates a problem. My actual menu has a main menu that[/color]
            never[color=blue]
            > disappears. When a user moves the mouse over one of the links in the main
            > menu, a submenu appears (javascript sets visibility to visible). Then the
            > submenu should disappear (javascript sets visibility to hidden) when the[/color]
            mouse[color=blue]
            > moves out of the submenu DIV.[/color]

            Ah-ha. A statement of the *real* problem.

            Well, you are re-inventing wheels. Go over to google and search for
            "javascript pulldown menu". There are hundreds of examples there. One of
            them should do what you want :-)

            One caveat: If you do this then make sure that your navigation still works
            with javascript disabled.

            Cheers
            Richard.


            Comment

            • delerious@no.spam.com

              #7
              Re: Problem: onmouseout being signaled w/o leaving the element!

              On Thu, 11 Dec 2003 01:52:16 GMT, "rf" <making.it.up@t he.time> wrote:[color=blue]
              >Ah-ha. A statement of the *real* problem.
              >
              >Well, you are re-inventing wheels. Go over to google and search for
              >"javascript pulldown menu". There are hundreds of examples there. One of
              >them should do what you want :-)
              >
              >One caveat: If you do this then make sure that your navigation still works
              >with javascript disabled.[/color]

              Yeah I know, but I think those free javascript menus all fix the size of the
              text. Isn't it poor web page design to not let the user change the text size?

              Comment

              • Toby A Inkster

                #8
                Re: Problem: onmouseout being signaled w/o leaving the element!

                delerious wrote:[color=blue]
                > Yeah I know, but I think those free javascript menus all fix the size of the
                > text. Isn't it poor web page design to not let the user change the text size?[/color]

                Try the one at http://devedge.netscape.com/ -- it is probably the best out
                there.

                --
                Toby A Inkster BSc (Hons) ARCS
                Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

                Comment

                Working...