Mouseout events will fire when you mouse over a child element inside of the parent. So if your menu has a div inside of it, that can be seen as a mouse out. What you need to do is loop at the event.srcElement || event.target and see if any of its parentNodes is your menu heading. If it is not, than you hide it. You might be better off just finding a menu that is already made. There are plenty of free ones out there.