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

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

為什么出不來動(dòng)畫效果

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>圖像</title>
</head>
<style>
*{margin:0;padding:0;font-size:14px;}
ul{list-style:none;height:50px;border-bottom:#F30 solid 5px;padding-left:50px;}
li{float:left;margin-top:20px;}
.on,a:hover{background:#F00;color:#FFF;}
a{text-decoration:none;display:block;width:120px;background:url(1.jpg);line-height:30px;height:30px;text-align:center;}


<script>
window.onload=function(){
? var aA=document.getElementsByTagName('a');
? for(var i=0;i<aA.length;i++)
? {
?? ?? aA[i].onmouseover=function(){
?? ??? ?? var This=this;
?? ??? ?? This.time=setInterval(function(){
?? ??? ?? This.style.width=This.offsetWidth+8+"px";
?? ??? ?? },30)
?? ?? }
?? ??? ?? if(This.offetWidth>=130){
?? ??? ???? clearInterval(This.time);
?? ??? ?? }?? ?
? }
}

</script>
</style>
<body>
<ul>
? <li><a class="on" href="#">名?? 字</a></li>
? <li><a href="#">畢業(yè)學(xué)校</a></li>
? <li><a href="#">性?? 別</a></li>
? <li><a href="#">出生年月</a></li>
? <li><a href="#">學(xué)?? 位</a></li>

</ul>


</body>
</html>

正在回答

3 回答

同學(xué),你的<script>放到了<style>里了,當(dāng)然出不來了.把它放在body里或者h(yuǎn)ead里的style下面,不要放里面.

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

weibo_一光年_sunshi_03642119 提問者

這個(gè)我這里弄錯(cuò)了 我發(fā)現(xiàn)改過來后還是不對
2016-08-12 回復(fù) 有任何疑惑可以回復(fù)我~
#2

Accidie漠然 回復(fù) weibo_一光年_sunshi_03642119 提問者

你應(yīng)該是想要實(shí)現(xiàn)這節(jié)視頻里的效果,里面有幾點(diǎn)錯(cuò)誤. 1.檢測li標(biāo)簽的if語句位置不對,應(yīng)該放到onmouseover語句的里面,this.offsetWidth+8+"px"的下面.而且你if語句里的條件寫錯(cuò)了,是offsetWidth,不是offetWidth. 2.少寫了一條onmouseout語句,也就是鼠標(biāo)移出的語句. 修改后的代碼給你貼在下面.
2016-08-12 回復(fù) 有任何疑惑可以回復(fù)我~
for(var?i=0;i<aA.length;i++)
{
????aA[i].onmouseover=function(){
????????var?This=this;
????????This.time=setInterval(function(){
????????????This.style.width=This.offsetWidth+8+"px";
????????????if(This.offsetWidth>=130){
????????????????clearInterval(This.time);
????????????}
????????},30)
????}
????aA[i].onmouseout=function(){
????????var?This=this;
????????This.time=setInterval(function(){
????????????This.style.width=This.offsetWidth-8+"px";
????????????if(This.offsetWidth<=130){
????????????????clearInterval(This.time);
????????????}
????????},30)
????}
}


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

js代碼貌似不能寫在css代碼里邊

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

舉報(bào)

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

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

進(jìn)入課程

為什么出不來動(dòng)畫效果

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

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

幫助反饋 APP下載

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

公眾號

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