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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么我這段代碼實(shí)現(xiàn)不了最開始的伸長(zhǎng)JS動(dòng)畫啊,總是提示錯(cuò)誤 Cannot set property 'width' of undefined"


<!DOCTYPE?html>
<html>
	<head>
		<meta?charset="UTF-8">
		<title>橫向菜單</title>
		<style>
			*{margin:0;padding:0}
			ul{
				list-style:?none;
				height:?50px;
				border-bottom:?solid?5px?#F60;
			}
			li{
				float:left;
				margin-top:20px;
			}
			a{
				text-decoration:?none;
				display:?block;
				height:30px;
				width:?120px;
				line-height:?30px;
				margin-bottom:?1px;
				text-align:?center;
				background:?lightgrey;
			}
			.on,a:hover{
				color:white;
				background:?orangered;
				height:30px;
				width:120px;
				line-height:30px;
			}
		</style>
		<script>
			window.onload=function(){
				var?A=document.getElementsByTagName('a');
				for(var?i=0;i<A.length;i++)
				{
					var?This=this;
					A[i].onmouseover=function(){
						setInterval(function(){
							This.style.width=This.offsetWidth+8+"px";
						},30);
					}
				}
			}
		</script>
	</head>
	<body>
		<ul>
			<li><a?class="on"?href="#">首????????頁(yè)</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 回答

var?This=this;寫在onmouseover里面

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

小S澀 提問者

非常感謝!
2016-05-24 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

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

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

進(jìn)入課程

為什么我這段代碼實(shí)現(xiàn)不了最開始的伸長(zhǎng)JS動(dòng)畫啊,總是提示錯(cuò)誤 Cannot set property 'width' of undefined"

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

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

幫助反饋 APP下載

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

公眾號(hào)

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