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

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

初學(xué)菜鳥,找不出問題,求大神告知為何沒有效果


<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>水導(dǎo)航</title>

<style type="text/css">

*{

padding: 0;

margin: 0;

}

ul{

list-style: none;

height: 50px;

border-bottom: 2px solid lightblue;

}

ul li{

float: left;

width: 120px;

margin:0 1px;

position: relative;

left: 20px;

}

a{

text-decoration: none;

display: inline-block;

width: 100%;

height: 50px;

line-height: 50px;

background: bisque;

text-align: center;

border-top-left-radius: 20px;

border-top-right-radius: 15px;

}

.on,a:hover{

background-color: palegreen;

color: white;

border-bottom: 2px solid red;

}

</style>

<script type="text/javascript">

window.onload=function(){

var aA = document.getElementsByTagName(a);

for(var i=0;i<aA.length;i++){

? aA[i].onmouseover=function(){

? clearInterval(this.time);

? var This=this;

? setInterval(function{

? This.style.width=This.offsetWidth+8+"px";

? if (This.offsetWidth>=180) {

? clearInterval(This.time)

? }

? },30)

? }

? aA[i].onmouseout=function(){

? clearInterval(this.time);

? var This=this;

? 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="#">Ke 聞</a></li>

<li><a href="http://idcbgp.cn/">直 播</a></li>

<li><a href="#">軍 事</a></li>

<li><a href="#">經(jīng) 濟(jì)</a></li>

<li><a href="#">國 際</a></li>

<li><a href="#">社 會</a></li>

</ul>

</body>

</html>


正在回答

6 回答

setInterval(function{ 少了括號? 應(yīng)該是setInterval(function(){? ?,? 然后應(yīng)該是This.time=setInterval(function( ) { ,? ?document.getElementsByTagName(a); 括號里沒加引號應(yīng)該是document.getElementsByTagName(“a”);?

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

雙人魚L 提問者

非常感謝!,雖然時間太久,我會去試試。
2017-11-08 回復(fù) 有任何疑惑可以回復(fù)我~

第一,獲取a標(biāo)簽有引號,你沒有添加。第二,clearInterval(This.time),你有一次小寫了this。第三,設(shè)置的定時器前面是個變量(也就是This.time=setInterval),不然你怎么取消定時器.

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

第一,獲取a標(biāo)簽有引號,你沒有添加。第二,clearInterVal(This.time),你兩次的不一樣。第三,設(shè)置的定時器前面是個變量(也就是This.time=setInterval),不然你怎么取消定時器.

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

沒用啊,大神咋辦

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

謝謝,我試試


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

"setInterval(function{"這個function后面圓括號,“this.style.width="120px";”這里的this應(yīng)該是Tish

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

舉報

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

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

進(jìn)入課程

初學(xué)菜鳥,找不出問題,求大神告知為何沒有效果

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

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

幫助反饋 APP下載

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

公眾號

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