国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

js實現頂部可折疊的菜單工具欄效果實例

2019-11-20 12:31:28
字體:
來源:轉載
供稿:網友

本文實例講述了js實現頂部可折疊的菜單工具欄效果。分享給大家供大家參考。具體實現方法如下:

<!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>可以折疊的菜單工具欄</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 a{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<to?'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=""><img src="1.gif" width="231" height="58" alt="" /></a><a href="#" title=""><img src="2.gif" width="231" height="58" alt="" /></a></div><div id="btn_offOn"><a href="#" title=""></a></div></div></body></html>

希望本文所述對大家的javascript程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 涟源市| 余江县| 娄底市| 景泰县| 进贤县| 淮安市| 方正县| 宣汉县| 神池县| 黎平县| 孙吴县| 康马县| 铁岭市| 庐江县| 寻乌县| 宁化县| 兰溪市| 乳源| 永昌县| 舟曲县| 罗定市| 嘉义市| 永川市| 白城市| 邹城市| 依兰县| 吴旗县| 云龙县| 西充县| 渑池县| 黄龙县| 连江县| 横峰县| 松潘县| 搜索| 谢通门县| 库尔勒市| 两当县| 连云港市| 西充县| 轮台县|