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

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

為什么我的毫無反應呢??半天都沒找出來。

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>JS多物體運動動畫</title>

<style type="text/css">

ul,li{

list-style:none;}

ul li{

width:200px;

height:100px;

background:yellow;

margin-bottom:20px;}

</style>

<script type="text/avascript">

?window.onload=function(){

var aLi=document.getElementsByTagName("li");//aLi為數(shù)組

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

{

aLi.time=null;

aLi[i].onmouseover=function(){

startMove(this,400);

}

aLi[i].onmouseout=function(){

startMove(this,200);

}

}

?}

? ? aLi[i].timer=null;

function startMove(obj,terget){

clearInterval(obj.timer);

obj.timer=setInterval(function(){

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

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

if(obj.offsetWidth==terget){clearInterval(obj.timer);}?

else{obj.style.width=obj.offsetWidth+speed+"px";

},30)

?

}

</script>

</head>


<body>

?<ul>

? ?<li></li>

? ?<li></li>

? ?<li></li>

?</ul>

</body>

</html>


正在回答

1 回答

你好,其實只是一些小問題,

<script type="text/avascript">是javascript,這個應該影響不大,

aLi.time=null;aLi[i].timer=null;//應該是點的哪一個

function startMove(obj,terget){

clearInterval(obj.timer);

obj.timer=setInterval(function(){

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

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

if(obj.offsetWidth==terget){clearInterval(obj.timer);}?

else{obj.style.width=obj.offsetWidth+speed+"px";

},30)? //掉了一個'}',這是主要的

<!doctype html>


<html>


<head>


<meta charset="utf-8">


<title>JS多物體運動動畫</title>


<style type="text/css">


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 aLi=document.getElementsByTagName("li");//aLi為數(shù)組


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


aLi[i].timer=null;


aLi[i].onmouseover=function(){


startMove(this,400);


}


aLi[i].onmouseout=function(){


startMove(this,200);


}


}


?}




function startMove(obj,terget){


clearInterval(obj.timer);


obj.timer=setInterval(function(){


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


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


if(obj.offsetWidth==terget){clearInterval(obj.timer);}


else{obj.style.width=obj.offsetWidth+speed+"px";


}
},30)


?


}


</script>


</head>





<body>


?<ul>


?? <li></li>


?? <li></li>


?? <li></li>


?</ul>


</body>


</html>

?


0 回復 有任何疑惑可以回復我~
#1

若憶淺擱 提問者

非常感謝!我把 j 補上去就可以了
2016-03-21 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
JS動畫效果
  • 參與學習       113920    人
  • 解答問題       1489    個

通過本課程JS動畫的學習,從簡單動畫開始,逐步深入各種動畫框架封裝

進入課程

為什么我的毫無反應呢??半天都沒找出來。

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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