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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

關(guān)于js制作側(cè)拉動(dòng)畫(huà)的問(wèn)題

關(guān)于js制作側(cè)拉動(dòng)畫(huà)的問(wèn)題

MR158 2016-02-03 18:12:54
<!DOCTYPE?html> <html> <head> <title></title> <style?type="text/css"> *{ margin:0; padding:0; } #sdiv{ width:?200px; height:200px; background-color:skyblue; float:left; } #div{ width:?300px; height:200; position:relative; left:?-200px; } #span{ float:left; font-size:?20px; background:?#456; margin-top:?80px; line-height:?18px; } </style> <script?type="text/javascript"> window.onload=function(){ var?span=document.getElementById("span"); var?div=document.getElementById("div"); var?sdiv=document.getElementById("sdiv"); span.onmouseover=function(){ move(0); } sdiv.onmouseout=function(){ move(-200) } } function?move(target){ var?div=document.getElementById("div"); var?speed=0; clearInterval(timer); var?timer=setInterval(function(){ if?(div.offsetLeft==target)?{ clearInterval(timer) }else?if(div.offsetLeft<target){ speed?=?10; div.style.left=div.offsetLeft+speed+"px"; }else?if(div.offsetLeft>target){ speed?=?-10; div.style.left=div.offsetLeft+speed+"px" }; },30) } </script> </head> <body> <div?id="div"> <div?id="sdiv"></div> <span?id="span">分<br/>享</span> </div> </body> </html>一個(gè)onmouseover和onmouseout觸發(fā)的動(dòng)畫(huà),但在同時(shí)觸發(fā)時(shí)(比如移開(kāi)sdiv時(shí)同時(shí)經(jīng)過(guò)span的動(dòng)畫(huà)還在執(zhí)行)會(huì)給target輸入兩個(gè)值,如何解決這個(gè)問(wèn)題?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1403 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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