| <Html> <Head> <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"> <Title> layer expansion and collapse </title> </Head> <Body> <Style type = "text/css"> DIV. clTopMenu { Position: absolute; Width: 101; Height: 150; Clip: rect (0,101 ); Visibility: hidden; Z-index: 31; Layer-background-color: # EEEEEE; Background-color: #00 CCFF } DIV. clTopMenuBottom { Position: absolute; Width: 101; Height: 3; Clip: rect (0,101 ); Top: 11; Layer-background-color: # CECFCE; Background-color: #000099; Z-index: 2 } DIV. clTopMenuText { Position: absolute; Width: 91; Left: 5; Top: 15; Font-family: "Arial", "Helvetica", "sans-serif "; Font-size: 9pt; Background-color: # EEEEEE; Z-index: 1; Color: #000000. } A: link { Color: #000000; Text-decoration: none } </Style> <Script language = "JavaScript" type = "text/javascript"> Function lib_bwcheck () {// Browsercheck (needed) This. ver = navigator. appVersion This. agent = navigator. userAgent This. dom = document. getElementById? 1:0 This. opera5 = this. agent. indexOf ("Opera 5")>-1 This. ie5 = (this. ver. indexOf ("MSIE 5")>-1 & this. dom &&! This. opera5 )? 1:0; This. ie6 = (this. ver. indexOf ("MSIE 6")>-1 & this. dom &&! This. opera5 )? 1:0; This. ie4 = (document. all &&! This. dom &&! This. opera5 )? 1:0; This. ie = this. ie4 | this. ie5 | this. ie6 This. mac = this. agent. indexOf ("Mac")>-1 This. ns6 = (this. dom & parseInt (this. ver)> = 5 )? 1:0; This. ns4 = (document. layers &&! This. dom )? 1:0; This. bw = (this. ie6 | this. ie5 | this. ie4 | this. ns4 | this. ns6 | this. opera5) Return this } Var bw = new lib_bwcheck () NPlace = 0 Var nNumberOfMenus = 2 Var nMwidth = 101 Var nPxbetween = 20 Var nFromleft = 10 Var nFromtop = 20 Var nBgcolor = '# CECFCE' Var nBgcolorchangeto = '# 6380BC' Var nImageheight = 11 Function makeNewsMenu (obj, nest ){ Nest = (! Nest )? "": 'Document. '+ nest + '.' This.css = bw. dom? Document. getElementById (obj). style: bw. ie4? Document. all [obj]. style: bw. ns4? Eval (nest + "document. layers." + obj): 0; This. evnt = bw. dom? Document. getElementById (obj): bw. ie4? Document. all [obj]: bw. ns4? Eval (nest + "document. layers." + obj): 0; This. scrollHeight = bw. ns4? This.css.doc ument. height: this. evnt. offsetHeight This. moveIt = B _moveIt; this. bgChange = B _bgChange; This. slideUp = B _slideUp; this. slideDown = B _slideDown; This. clipTo = B _clipTo; This. obj = obj + "Object"; eval (this. obj + "= this ") } Function B _moveIt (x, y) {this. x = x; this. y = y; this.css. left = this. x; this.css. top = this. y} Function B _bgChange (color) {if (bw. dom | bw. ie4) this.css. backgroundColor = color; else this.css. bgColor = color} Function B _clipTo (t, r, B, l ){ If(bw.ns4){this.css. clip. top = t; this.css. clip. right = r; this.css. clip. bottom = B; this.css. clip. left = l } Else this.css. clip = "rect (" + t + "," + r + "," + B + "," + l + ")"; } Function B _slideUp (ystop, moveby, speed, fn, wh ){ If (! This. slideactive ){ If (this. y> ystop ){ This. moveIt (this. x, this. y-5); eval (wh) SetTimeout (this. obj + ". slideUp ("+ ystop +", "+ moveby +", "+ speed +", '"+ fn +"', '"+ wh +"') ", speed) } Else { This. slideactive = false; this. moveIt (0, ystop); eval (fn) } } } Function B _slideDown (ystop, moveby, speed, fn, wh ){ If (! This. slideactive ){ If (this. y <ystop ){ This. moveIt (this. x, this. y + 5); eval (wh) SetTimeout (this. obj + ". slideDown ("+ ystop +", "+ moveby +", "+ speed +", '"+ fn +"', '"+ wh +"') ", speed) } Else { This. slideactive = false; this. moveIt (0, ystop); eval (fn) } } } Function newsMenuInit (){ OTopMenu = new Array () Zindex = 10 For (I = 0; I <= nNumberOfMenus; I ++ ){ OTopMenu [I] = new Array () OTopMenu [I] [0] = new makeNewsMenu ('divtopmenu '+ I) OTopMenu [I] [1] = new makeNewsMenu ('divtopmenubottom '+ I, 'divtopmenu' + I) OTopMenu [I] [2] = new makeNewsMenu ('divtopmenutext' + I, 'divtopmenu '+ I) OTopMenu [I] [1]. moveIt (0, nImageheight) OTopMenu [I] [0]. clipTo (0, nMwidth, nImageheight + 3, 0) If (! NPlace) oTopMenu [I] [0]. moveIt (I * nMwidth + nFromleft + (I * nPxbetween), nFromtop) Else { OTopMenu [I] [0]. moveIt (nFromleft, I * nImageheight + nFromtop + (I * nPxbetween )) Otopmenupolici=02.16.css. zIndex = zindex -- } Otopmenupolici=02.16.css. visibility = "visible" } } Function topMenu (num ){ If (oTopMenu [num] [1]. y = nImageheight) oTopMenu [num] [1]. slideDown (oTopMenu [num] [2]. scrollHeight + 20, 10, 40, 'oss-pmenu ['+ num +'] [0]. clipTo (0, nMwidth, oTopMenu ['+ num +'] [1]. y + 3, 0) ', 'otopmenu [' + num + '] [0]. clipTo (0, nMwidth, oTopMenu ['+ num +'] [1]. y + 3, 0 )') Else if (oTopMenu [num] [1]. y = oTopMenu [num] [2]. scrollHeight + 20) oTopMenu [num] [1]. slideUp (nImageheight, 10, 40, 'oss ['+ num +'] [0]. clipTo (0, nMwidth, oTopMenu ['+ num +'] [1]. y + 3, 0) ', 'otopmenu [' + num + '] [0]. clipTo (0, nMwidth, oTopMenu ['+ num +'] [1]. y + 3, 0 )') } Function menuOver (num) {oTopMenu [num] [1]. bgChange (nBgcolorchangeto )} Function menuOut (num) {oTopMenu [num] [1]. bgChange (nBgcolor )} Onload = newsMenuInit; </Script> <Div id = "divTopMenu0" class = "clTopMenu" align = "center" style = "height: 170; left: 20; top: 20 "> <span class =" css3 "> <a href =" # "onMouseOver =" menuOver (0) "onMouseOut =" menuOut (0) "onClick =" topMenu (0); if (bw. dom | bw. ie4) this. blur (); return false "> click to expand </a> </Span> <Div id = "divTopMenuText0" class = "clTopMenuText"> <Span class = "css3"> Click the back layer to expand JavaScript. Click the back layer to expand JavaScript. </Span> </Div> <Div id = "divTopMenuBottom0" class = "clTopMenuBottom" style = "top: 11; height: 10"> </div> </Div> </Div> </Body> </Html> |