hey all. i don't know js well at all. i'm trying to hide a div when the mouse rolls off it (dd menu). It is only sometimes hiding it. here's what i have: <div id="dropdown_menu" onmouseout="doSomething(event);"> <ul> <li>anchor tag with rollover image</li> <li>anchor tag with rollover image</li> </ul> </div> and the script (I found on the web) function doSomething(e) { if (!e) var e = window.event; var tg = (window.event) ? e.srcElement : e.target; if (tg.nodeName != 'DIV') return; var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement; while (reltg != tg && reltg.nodeName != 'BODY') reltg= reltg.parentNode if (reltg== tg) return; // Mouseout took place when mouse actually left layer // Handle event hidediv("dropdown_menu");//another fx that works fine } thanks in advance.
if you need to change a lot of js object attributes i really suggest to use a javascript framework such as jquery, prototype, mootools... I've been using jQuery for a while now and it really rocks