最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

我的為什么實(shí)現(xiàn)不了,感覺沒有什么問題呀

<style type="text/css">

*{margin:0;padding:0;}

ul,li{

list-style:none;

}

ul li{

width:200px;

height:100px;

background:yellow;

margin-bottom:20px;

}

</style>

<script type="text/javascript">

window.onload=function(){

var lis=document.getElementsByTagName("li");

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

//lis[i].timer=null;

lis[i].onmouseover=function(){

startMove(this,400);

}

lis[i].onmouseout=function(){

startMove(this,200);

}

}

}

function startMove(obj,target){

clearInterval(obj.timer);

obj.timer=setInterval(function(){

var speed=(target-obj.offsetWidth)/8;

speed=speed>0?Math.ceil(speed):Math.floor(speed);

if(obj.offsetWidth==target){

clearInterval(timer);

}else{

obj.style.Width=obj.offsetWidth+speed+"px";

}

},30)

}

</script>

</head>


正在回答

3 回答

倒數(shù)第六行obj.style.Width=obj.offsetWidth+speed+"px";中前面Width大寫了,改成小寫即可

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

有可能是js的大括號(hào)沒配對好,我的就是這樣,你自己打開開發(fā)者工具看看出錯(cuò)在哪行就知道了 ? ?報(bào)錯(cuò):Uncaught SyntaxError: Unexpected end of input

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

clearInterval(timer); timer改成obj.timer

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

慕粉baby 提問者

我加上也不行,放在li標(biāo)簽上沒有反應(yīng)
2016-05-26 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

我的為什么實(shí)現(xiàn)不了,感覺沒有什么問題呀

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

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

幫助反饋 APP下載

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

公眾號(hào)

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