View Full Version : drop down menu upgrading

06-03-2006, 11:14 AM
Hello. I have a problem with upgrading a small drop-down-menu script which I have put here: http://paste.php.lv/3856. The problem is that when I get my mouse from the menu off, the sub-menus immediately dissapear, my question is this: how can I make the sub-menus stay 1 second after the mouse got from the sub-menu off.

06-03-2006, 11:34 AM
you link displays line numbers, this is a pain when copying

post a link to the page or provide as simple text

06-03-2006, 01:36 PM

06-03-2006, 02:06 PM
<script type="text/javascript">
var sfEls;
over = function() {
sfEls = document.getElementById("primary-nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
for (var zxc0=0;zxc0<sfEls.length;zxc0++){
if (sfEls[zxc0]!=this){
//sfEls[zxc0].className=sfEls[zxc0].className.replace(new RegExp(" over\\b"), ""); // need to work on this
} this.className+=" over";
sfEls[i].onmouseout=function() {

function Hide(obj){
zxcTO=setTimeout( function(){obj.className=obj.className.replace(new RegExp(" over\\b"), "");},1000);

if (window.attachEvent) window.attachEvent("onload", over);

06-03-2006, 03:07 PM
I was thinking about something like that, but previously my codes didn't work (I'm just starter at JS) My next question is - maybe can give me a clue why does it work in IE but not in FF ?

06-03-2006, 04:57 PM
Again a problem. http://www.lfka.lv/index2.htm see here when changing to other submenus faster than in 1 second, they just stay one on the other, how can I repair that?