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):
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.