Need help with a slide out menu

Discussion in 'JavaScript' started by absentx, May 5, 2010.

  1. #1
    Okay so I am very new to javascript, but I am trying to make the best of it!

    I have one button that I want to have a simple pop out menu on mouseover. I have the pop out menu working as It should but I need some help on getting the pop out to stay visible until the mouse has left either the original button or the pop out.

    Here is my code so far, I just need some help on the best way to structure the code to keep this thing open until the mouse leaves the whole area:

    
    
    <script type="text/javascript">
    
    window.onload = fancybuttons;
    
    	
    		
    	function fancybuttons() {
    		document.getElementById("menu").onmouseover = function(){
    			document.getElementById("buymenu").style.display = "block";	
    	}
    		document.getElementById("menu").onmouseout = function(){
    			document.getElementById("buymenu").style.display = "none";	
    		}
    	
           		
    }
    
    
    </script>
    
    Code (markup):
     
    absentx, May 5, 2010 IP
  2. absentx

    absentx Peon

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can anyone help me with this?

    Again, I think I just need some direction on divs and such to keep the menu out while the mouse is over both the original button and the actual menu.
     
    absentx, May 10, 2010 IP