第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我的代碼死活運行不出來效果。。。。幾乎完全copy的

<!DOCTYPE?html>
<html>
??<head>
????<meta?charset="utf-8">
????<title>導(dǎo)航欄</title>

????<style?media="screen">
??????ul{
????????list-style:?none;
????????width:?800px;
????????height:50px;
????????border-bottom:?5px?solid?rgb(14,?79,?126);
??????}
??????a{
????????text-align:?center;
????????display:?block;
????????width:?100px;
????????text-decoration:?none;
????????font-family:?黑體;
????????color:?rgb(0,0,0);
????????line-height:?30px;
????????font-size:?20px;
????????background:?rgb(189,?108,?108);
????????padding:?5px;
????????border-top-right-radius:?8px;
????????border-top-left-radius:?8px;
??????}
??????/*a:hover,a.on{
????????background:?rgb(29,?62,?122);
????????color:white;
????????width:?150px;
??????}*/
??????li{
????????float:?left;
????????margin-top:10px;

??????}
????</style>
????<script?type="text/javascript">
??????window.onload=function(){
????????var?oNav=document.getElementsByTagName('ul')[0];
??????	var?aA=oNav.getElementsByTagName('a');
????????for(var?i=0;?i<aA.length;?i++){
??????		aA[i].onmouseover=function(){
??????			if(this.className!="on"){
??????				clearInterval(this.timer);
??????				var?This=this;
??????				This.time=setInterval(function(){
??????					This.style.width=This.offsetWidth+8+"px";
??????					if(This.offsetWidth>=120)
??????					clearInterval(This.time);
??????				},30)
??????			}
??????		}
??????		aA[i].onmouseout=function(){
??????			if(this.className!="on"){
??????				clearInterval(this.time);
??????				var?This=this;
??????				this.time=setInterval(function(){
??????					This.style.width=This.offsetWidth-8+"px";
??????					if(This.offsetWidth<=80){
??????						This.style.width='80px';
??????						clearInterval(This.time);
??????					}
??????				},30)
??????			}
??????		}
??????	}
??????}
????</script>
??</head>
??<body>
????<ul>
??????<li><a?class="on"?href="#">首&nbsp&nbsp&nbsp&nbsp頁</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>


正在回答

1 回答

把a標簽里的padding拿掉。清除動畫里的是this.time不是this.timer。

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

weibo_Gingbery_0 提問者

非常感謝!
2016-12-16 回復(fù) 有任何疑惑可以回復(fù)我~
#2

weibo_Gingbery_0 提問者

非常感謝你的解答,請問為什么padding會影響到JS代碼效果呢?
2016-12-16 回復(fù) 有任何疑惑可以回復(fù)我~
#3

慕粉1022337361 回復(fù) weibo_Gingbery_0 提問者

可能由于速度設(shè)置,永遠達不到目標值,比如設(shè)置padding為10px,每次減或加7px,那就一直達不到目標。
2016-12-18 回復(fù) 有任何疑惑可以回復(fù)我~
#4

weibo_Gingbery_0 提問者 回復(fù) 慕粉1022337361

非常感謝您的回答~~~
2016-12-21 回復(fù) 有任何疑惑可以回復(fù)我~
查看1條回復(fù)

舉報

0/150
提交
取消
導(dǎo)航條菜單的制作
  • 參與學(xué)習(xí)       123855    人
  • 解答問題       838    個

水平、垂直、圓角導(dǎo)航條菜單,讓您的技術(shù)探索之路更高效

進入課程

為什么我的代碼死活運行不出來效果。。。。幾乎完全copy的

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號