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

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

物體不運(yùn)動,不知道問題出在哪兒?報錯信息是Uncaught TypeError: Cannot set property 'width' of undefined

<html>

<head>

<title>多物體運(yùn)動</title>

<meta charset="utf-8">

<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].onmouseover=function(){

startMove(this,400);

}

lis[i].onmouseout=function(){

startMove(this,200);

}

}

}

var timer=null;

function startMove(obj,iTarget){

clearInterval(timer);

timer=setInterval(function(){

? ? ? ? ? ? ? var speed=(iTarget-obj.offsetWidth)/10;

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

? ? ? ? ? ? ? if (obj.offsetWidth==iTarget) {

? ? ? ? ? ? ? clearInterval(timer);

? ? ? ? ? ? ? }

? ? ? ? ? ? ? else{

? ? ? ? ? ? ? obj.sytle.width=obj.offsetWidth+speed+'px';

? ? ? ? ? ? ? }

},50)

}

</script>

</head>

<body>

<ul>

<li></li>

<li></li>

<li></li>

</ul>

</body>

</html>


正在回答

2 回答

style拼錯了

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

not_afraid 提問者

謝謝
2016-05-17 回復(fù) 有任何疑惑可以回復(fù)我~

{obj.sytle.width=obj.offsetWidth+speed+'px'; } ?其中style 錯了

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

舉報

0/150
提交
取消

物體不運(yùn)動,不知道問題出在哪兒?報錯信息是Uncaught TypeError: Cannot set property 'width' of undefined

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

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

幫助反饋 APP下載

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

公眾號

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