need help with hide function

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

    need help with hide function

    Hey, Im working on a javascript based menu system :


    When the user first selected a menu-item the sub-menu appears nicly but if
    the user then moves the cursors away from the menu area the sub-menu still
    is shown. I need a function that hides the sub-menu. But Im not sure how do
    to this. Would appreciate some input on this matter.




  • D Elkins

    #2
    Re: need help with hide function

    "John Doe" <johndoe@email. com> wrote in message news:<3f8bcb79$ 1@news.broadpar k.no>...[color=blue]
    > Hey, Im working on a javascript based menu system :
    > http://larsandre.mine.nu/menu2.htm
    >
    > When the user first selected a menu-item the sub-menu appears nicly but if
    > the user then moves the cursors away from the menu area the sub-menu still
    > is shown. I need a function that hides the sub-menu. But Im not sure how do
    > to this. Would appreciate some input on this matter.[/color]


    Try putting something like this in the onload event of the body tag:

    setInterval('ch eckmenu()',4000 )

    in checkmenu check to see if any submenus are visible. If they are then hide them.

    Hope this helps.

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: need help with hide function

      D Elkins wrote:
      [color=blue]
      > "John Doe" <johndoe@email. com> wrote [...][color=green]
      >> When the user first selected a menu-item the sub-menu appears nicly but if
      >> the user then moves the cursors away from the menu area the sub-menu still
      >> is shown. I need a function that hides the sub-menu. But Im not sure how do
      >> to this. Would appreciate some input on this matter.[/color]
      >
      > Try putting something like this in the onload event of the body tag:[/color]

      It's the `body' _element_.
      [color=blue]
      > setInterval('ch eckmenu()',4000 )
      >
      > in checkmenu check to see if any submenus are visible. If they are then hide them.[/color]

      The better way is to put code into the `onmouseout' event handler of the
      menu area that hides all submenus. Not only that the interval is too long
      here (4 seconds?), it also steals the user computing time better to be used
      for other purposes.


      PointedEars

      Comment

      Working...