Using onMouseOut with Dropdowns


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Using onMouseOut with Dropdowns

  1. #1
    David Guest

    Using onMouseOut with Dropdowns


    I have built a set of dropdown menus, and I make the layers visible using
    <a href="url.htm" onMouseOver="showLayer('layername');"> with showLayer('layername')
    being a function to make the correct layer visible using the right syntax
    for the browser being used.

    This works great.

    My problem is how to make the dropdown go away. I cannot get the onMouseOut
    handler to work with the <div> tags I am using for the layers. Cross-browser
    compatibility is crucial.

    If anyone has any ideas, it would be much appreciated.

    Thanks in advance!

    David

  2. #2
    Michael Guest

    Re: Using onMouseOut with Dropdowns


    David,
    1 idea...instead of using the onmouseout event use the onblur event. That
    way if the page or the user moves the focus to another element it will register.
    Onmouseout typically doesnt' work on a div tag because it sets a division
    of the page not an actual element for an onmouseout event to occur.

    If you need help specific to your code, include it on the next round.

    Good luck and let me know if you have any questions.
    Michael


    "David" <007@007design.net> wrote:
    >
    >I have built a set of dropdown menus, and I make the layers visible using
    ><a href="url.htm" onMouseOver="showLayer('layername');"> with showLayer('layername')
    >being a function to make the correct layer visible using the right syntax
    >for the browser being used.
    >
    >This works great.
    >
    >My problem is how to make the dropdown go away. I cannot get the onMouseOut
    >handler to work with the <div> tags I am using for the layers. Cross-browser
    >compatibility is crucial.
    >
    >If anyone has any ideas, it would be much appreciated.
    >
    >Thanks in advance!
    >
    >David



  3. #3
    Manoj Guest

    Re: Using onMouseOut with Dropdowns


    Hi David,
    What I have done is use a timer on the page and that checks after every second
    if the mouse is outside the menu area and if yes it hides the menu items.
    I'm not sure if this will work for you.

    Manoj
    "David" <007@007design.net> wrote:
    >
    >I have built a set of dropdown menus, and I make the layers visible using
    ><a href="url.htm" onMouseOver="showLayer('layername');"> with showLayer('layername')
    >being a function to make the correct layer visible using the right syntax
    >for the browser being used.
    >
    >This works great.
    >
    >My problem is how to make the dropdown go away. I cannot get the onMouseOut
    >handler to work with the <div> tags I am using for the layers. Cross-browser
    >compatibility is crucial.
    >
    >If anyone has any ideas, it would be much appreciated.
    >
    >Thanks in advance!
    >
    >David



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center