課程
/前端開發(fā)
/HTML/CSS
/導(dǎo)航條菜單的制作
有沒有做好的,我想?yún)⒖枷?/p>
2016-06-25
源自:導(dǎo)航條菜單的制作 5-2
正在回答
<!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> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>導(dǎo)航菜單</title> <style?type="text/css"> *?{?margin:?0;?padding:?0;?font-size:?14px;?} a?{?color:?#333;?text-decoration:?none?} ul?{?list-style:?none;?height:?30px;?border-bottom:?5px?solid?#F60;?margin-top:?20px;?padding-left:?50px;?} ul?li?{?float:?left?} ul?li?a?{?display:?block;?height:?30px;?text-align:?center;?line-height:?30px;?width:120px;?background:?#efefef;?margin-left:?1px;?} a.on,?a:hover?{?background:?#F60;?color:?#fff;?} </style> <script> window.onload=function(){ ????var?aA=document.getElementsByTagName('a'); for(var?i=0;?i<aA.length;?i++){ aA[i].onmouseover=function(){ var?This=this; clearInterval(This.time); This.time=setInterval(function(){ This.style.width=This.offsetWidth+8+"px"; if(This.offsetWidth>=160) clearInterval(This.time); },30) } aA[i].onmouseout=function(){ clearInterval(this.time); var?This=this; this.time=setInterval(function(){ This.style.width=This.offsetWidth-8+"px"; if(This.offsetWidth<=120){ This.style.width='120px'; clearInterval(This.time); } },30) } } } </script> </head> <body> <ul> ????<li><a?class="on"?href="#">首 頁</a></li> ????<li><a?href="#">新聞快訊</a></li> <li><a?href="#">產(chǎn)品展示</a></li> ????<li><a?href="#">售后服務(wù)</a></li> ????<li><a?href="#">聯(lián)系我們</a></li> </ul> </body> </html>
舉報(bào)
水平、垂直、圓角導(dǎo)航條菜單,讓您的技術(shù)探索之路更高效
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-06-25