Take a look at the following:
http://blogs.msdn.com/howard_dierking/archive/2007/04/23/polymorphic-javascript-well-kind-of.aspx?CommentPosted=true#commentmessage
Thanks to the author, I am now able to delay expanding of menu
when you move your mouse over it. The solution works great for me although it may not be efficient.
The menu won't expand unless you stay on the menu for a specific amount of time.
Here's the code I put in my master page, between the <head> and </head> tags.
(Remember to call the function initInterceptors() in <body> tag, <body onload="initInterceptors()" ..>)
1 <!-- @BEGIN:: JavaScript to prevent the expanding of static menu when you quickly mouse over them -->
2 <!-- A big thanks to hdierking -->
3 <!-- Reference website: http://blogs.msdn.com/howard_dierking/archive/2007/04/23/polymorphic-javascript-well-kind-of.aspx?CommentPosted=true#commentmessage -->
4 <script type="text/javascript">
5 var myVar;
6 var myTimeoutID;
7 var myNode, myData;
8 var ref_Menu_HoverStatic;
9 var ref_Menu_Unhover;
10 var ref_overrideMenu_HoverStatic;
11
12 // This function is called in <body onload="...">
13 function initInterceptors()
14 {
15 // *** Interceptors ***
16 // @:: Menu_Hover
17 ref_Menu_HoverStatic = Menu_HoverStatic;
18 Menu_HoverStatic = My_Menu_HoverStatic;
19
20 // @:: Menu_Unhover
21 ref_Menu_Unhover = Menu_Unhover;
22 Menu_Unhover = My_Menu_Unhover;
23
24 // @:: overrideMenu_HoverStatic
25 ref_overrideMenu_HoverStatic = overrideMenu_HoverStatic;
26 overrideMenu_HoverStatic = My_overrideMenu_HoverStatic;
27 }
28
29 function My_Menu_HoverStatic(item)
30 {
31 My_overrideMenu_HoverStatic(item);
32 }
33
34 function My_overrideMenu_HoverStatic(item)
35 {
36 var node = Menu_HoverRoot(item);
37 var data = Menu_GetData(item);
38 myNode=node;
39 myData=data;
40 if (!data) return;
41
42 myVar = item;
43 myTimeoutID=setTimeout("My_DelayExpandMenu(myNode,myData)",200);
44 }
45
46 function My_DelayExpandMenu(node, data)
47 {
48 __disappearAfter = 100; //data.disappearAfter;
49 Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
50 }
51
52 function My_Menu_Unhover(item)
53 {
54 clearTimeout(myTimeoutID);
55 ref_Menu_Unhover(item);
56 }
57
58 </script>
59 <!-- ~END:: JavaScript to prevent the expanding of static menu when you quickly mouse over them -->
60