This month has been doing a project. The homepage requires navigation bars like Zhejiang University (http://www-2.zju.edu.cn).
Analyze the code:
The first thing to have mm_menu.js files seem to be written by Macromedia,
* mm_menu 20mar2002 Version 6.0 * Andy Finnell, March 2002 * CopyRight (C) 2000-2002 Macromedia, Inc.
I don't know if it is a file contained in Dreamweaver.
download
http://www-2.zju.edu.cn/mm_menu.js
Then, between the
of the required page, call the fileFunction mmloadmenus () {if (window.mm_menu_0423132603_0) return; window.mm_menu_0423132603_0 = new menu ("root", 97, 26, "", "# 000000", "# ffffff", "# ffffff", "# 777777 "," Left "," Middle ", 8, -1, 1000, -5, 7, true, true, true, 0, true, true); mm_menu_0423132603_0.addMenuitem (" leaders "," Window.Open 'xqzl / ldzc.htm', '_self'); "); mm_menu_0423132603_0.addMenuItem (" School Overview "," Window.Open ('xqzl / xygk / xygk.htm', '_Self'); "); mm_Menu_0423132603_0. AddMenuItem ("Office Settings", "Window.Open ('Xqzl / YxSz.htm','_Self ');"); MM_MENU_0423132603_0.AddMenuItem ("Party and Government)", "Window.Open (' xqzl / dzjg / dzjg .htm ',' _self '); "); mm_menu_0423132603_0.addMenuitem (" School Sign "," Window.Open (' Xqzl / Biaozhi / Bz.htm ','_Menu_0423132603_0.addMenuItem " "" Window.Open ('xqzl / lsyg / lsyg.htm', '_self'); "); mm_menu_0423132603_0.addMenuItem (" Hiri President "," Window.Open ('xqzl / lrxz / lrxz.htm ", '_self'); "); mm_menu_0423132603_0.addMenuItem (" Campus List "," Window.Open ('xqzl / xqyl / xqly.htm', '_self'); "); mm_menu_0423132603_0.addMenuItem (" Campus Landscape " , "Window.Open ('xqzl / fj / fj.htm', '_self');"); mm_menu_0423132603_0.addMenuItem ("statistics", "window.Open ('xqzl / tj / tj.htm', '_self '); "); Mm_menu_0423132603_0.addMenuItem (" Zhejiang University Gallery "," Window.Open (' http://www-2.zju.edu.cn/~Piclib/ ',' _blank '); "); mm_Menu_0423132603_0. AddMenuItem ("Mars", "Window.Open"
xqzl / dsj / dsj4.htm ',' _self '); "); mm_menu_0423132603_0.hideOnMouseOut = true; mm_menu_0423132603_0.bgColor =' # ffffff '; mm_menu_0423132603_0.menuBorder = 1; mm_menu_0423132603_0.menuLiteBgColor =' # FFFFFF '; mm_menu_0423132603_0.menuBorderBgColor = '# 999999; window.mm_menu_0423205435_0 = new menu ("Root", 115, 26, "" # ffffff "," #ffff "," # 777777 "," left ", "Middle", True, True, True, 0, True, True, True, 0, True, True; MM_MENU_0423205435_0.AddMenuItem ("Graduate Education", "WINDOW.Open ('RCPY / YJSJY / YJSJY. HTM ','_Self'); "); mm_menu_0423205435_0.addMenuitem (" undergraduate education "," "RCPY / BKSJY / BKSJY.HTM ',' _SELF ');"); mm_menu_0423205435_0.addMenuItem ("Student Education, "WINDOW.Open ('gjl / gjjy.htm', '_self');"); mm_menu_0423205435_0.addMenuItem ("Adult Education", "Window.Open ('http://www.cj.zju.edu .cn / ',' _blank '); "); mm_menu_0423205435_0.addMenuItem (" distance education "," window.open (' http://www.zjuyc.com/index.jsp ',' _blank '); ") MM_MENU_0423205435_0.AddMenuItem ("Teacher Training", "Window.Open ('RCPY / SZPX / SZ.HTM','_Self ');"); MM_MENU _0423205435_0.addMenuItem ( "subject base", "window.open ( 'rcpy / xkjd.htm', '_self');"); mm_menu_0423205435_0.hideOnMouseOut = true; mm_menu_0423205435_0.bgColor = '# ffffff'; mm_menu_0423205435_0.menuBorder = 1 ; Mm_menu_0423205435_0.menuliteBGColor = '# fffff'; mm_Menu_0423205435_0.menuborderbgcolor = '# 999999;
......
......
......
} // mmloadmenus () end, mainly used to generate a MENU object, each object corresponds to a Menu block, for example:
Window.mm_Menu_0423132603_0 = New Menu ("Root", 97, 26, "", "# 000000", "# ffffff", "# ffffff", "# 77777", "left", "middle", 8, -1, 1000, -5, 7, true, true, true, 0, true, true
Note "MM_MENU_0423132603_0" is used to distinguish between different MENU blocks, and the subsequent 97, 26 represents pop-up MUNU width and high 14 representative font size.
Add, some necessary functions
Function mm_preloadImages () {//v3.0 var d = document; if (d.im_p) {if (! D.mm_p) D.MM_P = new array (); var i, j = d.mm_p.length, a = Mm_preloadimages.arguments; for (i = 0; i Function mm_swapimgrestore () {//v3.0 Var i, x, a = document.mm_sr; for (i = 0; A && i Function mm_findobj (n, d) {//v4.01 var p, i, x; if (! d) d = document; if ((p = n.indexof ("?"))> 0 && parent.frames.length {D = parent.frames [n.substring (p 1)]. Document; n = n.substring (0, p);} if (! (= D [n]) && D.all) x = D. All [n]; for (i = 0;! X && i Function mm_swapimage () {//v3.0 Var i, j = 0, x, a = mm_swapimage.arguments; document.mm_sr = new array; for (i = 0; i <(a.length-2); i = 3) IF ((x = mm_findobj (a [i]))! = Null) {document.mm_sr [j ] = x; if (! X.osrc) x.osrc = x.src; x.src = a [ i 2];}} script> Of course don't forget