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

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

感覺我和老師寫的差不多啊怎么這么大問題啊,定時(shí)器還是一個(gè)感覺。。。大神幫我看下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>多物體運(yùn)動(dòng)</title>
<style type="text/css">
*{margin:0;padding:0;}
ul{
?? ?width:600px;
?? ?height:600px;
?? ?border:1px solid #000;
?? ?list-style:none;
}
li{
?? ?width:60px;
?? ?height:100px;
?? ?background:#F00;
?? ?display:block;
?? ?float:left;
?? ?margin:auto 0px auto 20px;
}
</style>
<script type="text/javascript">
window.onload=function(){
?? ?var aLi=document.getElementsByTagName('li');
?? ?
?? ?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,100)
?? ??? ?};
?? ?};
};
//var timer=null;
function startMove(obj,iTarget){
?? ?
?? ?clearInterval(obj.timer);
?? ?speed=(iTarget-obj.offsetHeight)/10;
?? ?speed=speed>0?Math.ceil(speed):Math.floor(speed);
?? ?obj.timer=setInterval(function(){
?? ??? ?if(obj.offsetHeight==iTarget){
?? ??? ??? ?clearInterval(obj.timer);
?? ??? ?}
?? ??? ?else{
?? ??? ??? ?obj.style.height=obj.offsetHeight+speed+'px';
?? ??? ?}
?? ?},30)
};
</script>
</head>

<body>
<ul>
?? ?<li></li>
??? <li></li>
??? <li></li>
??? <li></li>
??? <li></li>
??? <li></li>
??? <li></li>
</ul>
</body>
</html>

正在回答

2 回答

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

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

<style type="text/css">

*{margin:0;padding:0;}

ul{

? ? width:600px;

? ? height:600px;

? ? border:1px solid #000;

? ? list-style:none;

}

li{

? ? width:60px;

? ? height:100px;

? ? background:#F00;

? ? display:block;

? ? float:left;

? ? margin:auto 0px auto 20px;

}

</style>

<script type="text/javascript">

window.onload=function(){

? ? var aLi=document.getElementsByTagName('li');

? ??

? ? 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,100)

? ? ? ? };

? ? };

};

//var timer=null;

function startMove(obj,iTarget){

? ??

? ? clearInterval(obj.timer);

? ??

? ? obj.timer=setInterval(function(){

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

? ? ? ? ? ? clearInterval(obj.timer);

? ? ? ? }

? ? ? ? else{

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

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

? ? ? ? obj.style.height=obj.offsetHeight+speed+'px';

? ? ? ? }

? ? },30)

};

</script>

</head>


<body>

<ul>

? ? <li></li>

? ? <li></li>

? ? <li></li>

? ? <li></li>

? ? <li></li>

? ? <li></li>

? ? <li></li>

</ul>

</body>

</html>

這樣就對(duì)了,把speed變化的代碼寫在定時(shí)器內(nèi)部。

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

舉報(bào)

0/150
提交
取消

感覺我和老師寫的差不多啊怎么這么大問題啊,定時(shí)器還是一個(gè)感覺。。。大神幫我看下

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

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

幫助反饋 APP下載

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

公眾號(hào)

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