Function menustyle (){ If (window. navigator. appname = "Microsoft Internet Explorer" & window. navigator. appversion. substring (window. navigator. appversion. indexof ("MSIE") + 5, window. navigator. appversion. indexof ("MSIE") + 8)> = 5.5) Isie = 1; Else Isie = 0; If (isie ){ Menucontent = '<Table id = "rightmenu" width = "0" Height = "0" cellspacing = "0" cellpadding = "0" style = "Font: menu; color: menutext; "> <tr Height =" 1 "> <TD style =" Background: black "colspan =" 4 "> </TD> </tr> <tr Height =" 10 "> <TD style =" Background: black "> </TD> <TD style =" Background: snow "> <Table cellspacing =" 0 "cellpadding =" 0 "nowrap style =" Font: menu; color: menutext; cursor: default; "> '; // This row draws a table. from below, add the project in the table and provide the MO Useover. The most important thing is that the function called by the onclick event is parent. fnclickmenu. Note that the function of the parent window is called. For (m = 0; m <menuitems. length; m ++ ){ If (menuitems [m] [0] & menuitems [m] [2]) Menucontent + = '<tr Height = "17" onmouseover = "this. style. background =/'# 9999cc/'; this. style. color =/'menutext/'; "onmouseout =" this. style. background =/'snow/'; this. style. color =/'menutext/'; "onclick =" parent. fnclickmenu (/''+ menuitems [m] [1] + '/')" <TD style = "Background: threedface "width =" 1 "nowrap> </TD> <TD width =" 21 "nowrap> </TD> <TD nowrap> '+ menuitems [m] [0] +' </TD> <TD width = "21" nowrap> </TD> <TD style = "Background: threedface "width =" 1 "nowrap> </TD> </tr> '; Else if (menuitems [m] [0]) Menucontent + = '<tr Height = "17" onmouseover = "this. style. background =/'# 9999cc/'; this. style. color =/'menutext/'; "onmouseout =" this. style. background =/'snow/'; this. style. color =/'menutext/'; "onclick =" parent. fnclickmenu (/''+ menuitems [m] [1] + '/')"> <TD style = "Background: threedface "width =" 1 "nowrap> </TD> <TD width =" 21 "nowrap> </TD> <TD nowrap> '+ menuitems [m] [0] + '</TD> <TD width = "21" nowrap> </TD> <TD style = "Background: threedface "width =" 1 "nowrap> </TD> </tr> '; Else Menucontent + = '<tr> <TD colspan = "5" Height = "4"> </TD> </tr> <TD colspan = "5"> <table cellspacing = "0"> <tr> <TD width = "2" Height = "1"> </TD> <TD width = "0" Height = "1" Style = "Background: threedshadow "> </TD> <TD width =" 2 "Height =" 1 "> </TD> </tr> <TD width =" 2 "Height = "1"> </TD> <TD width = "100%" Height = "1" style = "Background: threedhighlight "> </TD> <TD width =" 2 "Height =" 1 "> </TD> </tr> </table> </TD> </tr> <tr> <TD colspan = "5" Height = "3"> </TD> </tr> '; } Menucontent + = '</table> </TD> <TD style = "Background: threedshadow"> </TD> <TD style = "Background: threeddarkshadow "> </TD> </tr> <tr Height =" 1 "> <TD style =" Background: threedlightshadow "> </TD> <TD style =" Background: threedhighlight "> </TD> <TD style =" Background: threedface "> </TD> <TD style =" Background: threedshadow "> </TD> <TD style =" Background: threeddarkshadow "> </TD> </tr> <tr Height =" 1 "> <TD style =" Background: threedlightshadow "> </TD> <TD style =" Background: threedshadow "colspan =" 3 "> </TD> <TD style =" Background: threeddarkshadow "> </TD> </tr> <tr Height =" 1 "> <TD style =" Background: threeddarkshadow "colspan =" 5 "> </TD> </tr> </table> '; // A menu is displayed below. Menupopup = Window. createpopup (); // The items in the menu are shown in the table above. Menupopup.doc ument. Body. innerhtml = menucontent; |