[Original] Modified STEDYMENU for the JS version of the dynamic increase, as shown, and assigned JS code

xiaoxiao2021-03-06  109

1. Use STEDYSOFT 2k3 Menu's pictures, CSS, and 3 HTC: 2k3menuBar.htc, 2k3Menu.htc, 2k3menuroot.htc2. Where you need to modify is the Modified to , will then change the MENU to SubMenu for HTC; 3. The JS script I modified is as follows: var omenubar; // nodes.add (" R ", 4," p3 "," item0 "); // add (NULL, 0," R "," root "); / * Function: Add menu item parameter: ParentItem: ID of the superior node, if null Then, the first menu item level: menu level. 0: First 1: Last: Next 3: Previous 4: Submenu Item: Menu ID ItemName: Menu Name EXAMPLE: Insert the first menu AddItem (Null, 0, "Item1", "I am the first A menu "); * / function additem (ParentItem, Level, Item, ItemName, ItemTILE, ITEMCLICK, IMAGESRC) {// Add meNuroot IF ((ParentItem ==" null ") || (Level == 0)) { // Add a menubar omenubar = document.all.item ("_ menubar"). Firstchild.FirstChild; var OITEM = Omenubar.Isertcell (Omenubar.cells.Length - 1); with (OITEM) {ID = item; height = " 25 "; noWrap = true; classname =" 2k3menuroot "; // title = itemtitle; innerhtml ="

" itemname ";}} // Add submenu if ((ParentItem! = "NULL") || (ParentItem! = ")) {if (level == 4) {var OsubMenuItem =" _ SubMenu _ " ParentItem; var oparentMenu = document.all.item (ParentItem); / / If you can't find the parent menu if (OparentMenu == null) {return;} var} var Osubmenu = document.all.item (OSubMenuItem);

IF (OSubMenu == Null) {createMenu (OSubMenuItem); OsubMenu = Document.all.item (OSubMenuItem); // Return; Document.all.item (ParentItem). Submenu = OsubMenuItem;

} // Not menuroot, add an arrow if (OparentMenu.classname! = "2k3menuroot") {OparentMenu.cells (OparentMenu.Cells.Length - 2) .ClassName = "2k3Menumore";} // Add a line of split line IF (itemname == "-") {var orow = osubmenu.tbodies (0). INSERTROW (); with (orow) {classname = "2k3menuseperator"; var ocell = INSERTCELL (); Ocell.className = "2k3Menuimage"; Ocell.colspan = "2"; Ocell = INSERTCELL (); Ocell.className = "2k3MenuCaption"; Ocell.Colspan = "3"; Ocell.innerHTML = "";}} else if (itemname! = Null) {var orow = oSubMenu.tBodies (0) .insertRow (); with (oRow) {className = "2k3MenuItem"; id = item; title = itemTitle; var oCell = insertCell (); oCell.clsssName = "2k3MenuVerticalSpacerLeft"; oCell = insertCell ( ); Ocell.className = "2k3Menuimage"; Ocell.innerHtml = "" = INSERTCELL (); Ocell.className = "2k3Menucaption"; Ocell.innertext = itemname; Ocell = INSERTCELL (); OCE Ll.classname = "2k3menunomore"; Ocell.innertext = "4"; Ocell = INSERTCELL (); Ocell.className = "2k3menuverTicalSpaceerRight";}}}}}

Function createmenubar () {var htmlstr = "

"; htmlstr = ""; htmlstr = "
"; // htmlstr = "
file "; htmlstr ="
"; htmlstr =" "; htmlstr =" "; Document.write (HTMLSTR);} function CreateMenu (item) {var htmlstr; htmlstr = "; htmlstr =" < Tr> "; htmlstr = ""; htmlstr = "
"; htmlstr ="
"; htmlstr = ""; document .write (htmlstr);

///document.οnclick=function ket .//iff .////////iff

Function doclick () {var el = window.event.srcelement;

IF (el.parentelement.classname == "2k3Menuimage") {EL = el.parentelement.parentelement;} else f ((el.classname == "2k3menuverTICALSPACERLEFT") | (El.classname == "2k3MenuCaption") | (EL ") | .classname == "2k3Menunomore") | (el.classname == "2k3menuverTicalSpaceerRight")) {EL = El.parentelement;} else {return} //lert (((el.classname == " 2k3MenuItem ") | (El.classname ==" 2k3MenuItem ")) {alert (el.id);}} 5. Example application.

转载请注明原文地址:https://www.9cbs.com/read-102516.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.033, SQL: 9