<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <Html xmlns = "http://www.w3.org/1999/xhtml"> <Head> <Title> menu toolbar that can be folded </title> <Style> Html, body { Margin: 0; } Body { Url(img.jpg) repeat-x; } Ha { Margin: 0 auto; } Img { Border: none; } # Fx_topToolbar { Position: relative; top:-76px; left: 0; Margin: 0 auto; height: 92px; Background: #0C3E74; width: 700px; Text-align: center; } # Fx_topToolbar. shell { Margin: 0 auto; padding: 13px 0; } # Btn_offOn { Position: absolute; bottom:-8px; Left: 20px; height: 24px; width: 150px; Background: url(img34.gif) no-repeat; } # Btn_offOn { Display: block; zoom: 1; height: 24px; Position: relative; right:-16px; Background: url(tip.gif) no-repeat 100% 0; } </Style> <Script> (JS = { $: Function (o) {return typeof o = "string "? Document. getElementById (o): o }, On: function (o, type, fn ){ O. attachEvent? O. attachEvent ('on' + type, function () {fn. call (o)}): o. addEventListener (type, fn, false ); Return JS. on }, Move: function (who, attr, val, s, fn ){ Var fm = parseInt (who. style [attr]) | 0; ClearInterval (who ['timer _ '+ attr]); Var iFx = (function (form, to, s ){ Return function (){ Return form + = Math [form <? 'Ceil ': 'floor'] (to-form) * (s | 0.3 ))}; }) (Fm, val, s ); Who ['timer _ '+ attr] = setInterval (function (){ Var v = iFx (); Who. style [attr] = v + 'px '; If (v = val) {fn & fn. call (who); clearInterval (who ['timer _ '+ attr]);}; }, 18 ); } }). On (window, 'load', function (){ Var Q = JS. $ ('fx _ topToolbar '); Q. style. top ='-74px '; JS. on (JS. $ ('btn _ offon'), 'mouseover', function () {JS. move (Q, 'top', 0 )}) (Q, 'mouseout', function () {Q. outTimer = setTimeout (function () {JS. move (Q, 'top',-74)}, 10 )}) (Q, 'mouseover', function () {clearTimeout (this. outTimer )}); }) </Script> </Head> <Body> <Div id = "fx_topToolbar"> <Div class = "shell"> <A href = "#" title = ""> </A> <A href = "#" title = ""> </A> </Div> <Div id = "btn_offOn"> <a href = "#" title = ""> </a> </div> </Div> </Body> </Html> |