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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

【多個運動】函數(shù)哪里錯了?

【多個運動】函數(shù)哪里錯了?

胡子哥哥 2019-04-10 14:15:08
<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <meta http-equiv="X-UA-Compatible" content="ie=edge">    <title></title>    <style>    div {        width: 100px;        height: 50px;        background-color: red;        margin-top:50px;    }     </style>        <script type="text/javascript">                                                window.onload=function()        {            var aDiv = document.getElementsByTagName('div');            for(let i=0;i<aDiv.length;i++)            {                aDiv[i].timer = null;                aDiv[i].onmouseover = function ()                {                    startMove(this,300);                }                aDiv[i].onmouseout = function ()                {                    startMove(this,100);                }            }        }        function startMove(obj,iTarget)        {                clearInterval(obj.timer);                timer=setInterval(function () {                    var iSpeed = (iTarget - obj.offsetWidth)/8;                    iSpeed=iSpeed>0?Math.ceil(iSpeed):Math.floor(iSpeed);                    if(obj.offsetWidth == iTarget)                    {                        clearInterval(obj.timer);                    }                    else                    {                        obj.style.width = obj.offsetWidth + iSpeed + 'px';                    }                },30)        }    </script></head><body>    <div></div>    <div></div>    <div></div>        </body></html>
查看完整描述

3 回答

?
慕運維8079593

TA貢獻1876條經(jīng)驗 獲得超5個贊

obj.timer=setInterval(function(){},30)



查看完整回答
反對 回復(fù) 2019-05-12
  • 3 回答
  • 0 關(guān)注
  • 409 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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