/ *** Function: * Change menu color * Usage: * Apply to a second layer of nested DIV structure * The first layer of DIV ID should be the mnpMenutop * Second layer DIV menu item, classname is MNPMENUROW * author : * Kingapex * Last update date: * 2005-4-5 * /
Var mnpmenutop = null; var tempmenu = null; var overcolor = "# f4f4f4"; // mouse shift color var outcolor = "#fffff"; // mouse remove color var downcolor = "#cccccc"; // mouse down color
Window.attachevent ("OnLoad", MNPMenuinit);
Function mnpmenuinit () {mnpMenutop = document.getlementByid ("mnpmenutop"); mnpmenuattach (mnpmenutop);
Function Mnpmenuattach (EL) {var Divs = El.getElementsBytagname ("DIV"); var count = divs.length;
For (var i = 0; i } Function MnpmenumouseOver () {var div = window.event.srcelement; if (Div.GetaTribute ("flag")! = "1") {div.style.Background = overcolor;}} Function mnpmenumouseout () {var div = window.event.srcelement; if (Div.getaTribute ("flag")! = "1") {div.style.background = Outcolor;} Function mnpMenumounsedown () { IF (Tempmenu! = null) {/ / Restore TempMenu.settribute ("Flag", "0"); Tempmenu.Style.Background = Outcolor; Var div = window.event.srcelement; div.setttribute ("flag", "1"); // The mouse offs Div.Style.Background = DownColor; TempMenu = Div;