[Javascript] How could this happen?

Roland Dong rdong at advance.net
Mon Jul 18 11:25:06 CDT 2005


I am experimenting different ways to implement dhtml menu

Please click <http://www.wiu.edu/users/murbhd/menuTest.html>  here for the
file

 

 

I have problems with these two functions:

 

=================================================

function subMenuMouseOver(e) {

 //alert("in subover");

      var subMenu = subMenu.id;

      clearTimeout(TIMER);

      showSubMenu(subMenu);

}

 

function subMenuMouseOut() {

//    alert(" in subout");

      var subMenu = subMenu.id;

      function x() {

            clearSubMenu(subMenu);

      };

      TIMER=setTimeout(x, 1000);

}

===================================================

 

My intention is that when mouseover on submenu it will stay visible until
mouse moves out of the submenu.

What puzzles me is that if I add an alert in subMenuMouseOut function, the
alert is triggered even on mouseover. I do not understand why. What is wrong
with the code? Can someone explain and what is the work around?

 

Thanks

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050718/41bbbace/attachment.htm>


More information about the Javascript mailing list