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

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

為什么div的大小不能還原成200/200,請(qǐng)幫忙看下,TKS~!

<!DOCTYPE html>
<html>
?? ?<head>
?? ??? ?<meta charset="UTF-8">
?? ??? ?<title>運(yùn)動(dòng)框架檢驗(yàn)03</title>
?? ??? ?<style type="text/css">
?? ??? ??? ?*{margin: 0;padding: 0;list-style: none;}
?? ??? ??? ?div{
?? ??? ??? ??? ?width: 200px;
?? ??? ??? ??? ?height: 200px;
?? ??? ??? ??? ?border: 30px solid red;
?? ??? ??? ??? ?background: blue;
?? ??? ??? ??? ?margin: 50px auto;
?? ??? ??? ??? ?opacity: 1;
?? ??? ??? ?}
?? ??? ?</style>
?? ??? ?
?? ??? ?<script type="text/javascript" src="js/starMove.js"></script>
?? ??? ?<script type="text/javascript">
?? ??? ??? ?window.onload=function(){
?? ??? ??? ??? ?var odiv=document.getElementById("div");
?? ??? ??? ??? ?odiv.onmouseover=function(){
?? ??? ??? ??? ??? ?starMove(odiv,{width:400,height:400,opacity:0},function(){
?? ??? ??? ??? ??? ??? ?odiv.style.background="green";
?? ??? ??? ??? ??? ??? ?starMove(odiv,{width:200,height:200,opacity:100});
?? ??? ??? ??? ??? ?});
?? ??? ??? ??? ?};
?? ??? ??? ?};
?? ??? ?</script>
?? ?</head>
?? ?<body>
?? ??? ?<div id="div"></div>
?? ?</body>
</html>


正在回答

4 回答

function?startMove(obj,json,fn){
????clearInterval(obj.timer);
????obj.timer?=?setInterval(function(){
????????var?flag?=?true;
????????for(var?attr?in?json){
????????????var?typeValue?=?null;
????????????if(attr=="opacity")
????????????????typeValue?=?Math.round(parseFloat(getStyle(obj,attr))*100);
????????????else
????????????????typeValue?=?parseInt(getStyle(obj,attr));
????????????var?speed?=?(json[attr]-typeValue)/8;
????????????speed?=?speed>0??Math.ceil(speed):Math.floor(speed);
????????????if(typeValue!=json[attr]){
????????????????console.info(flag)
????????????????flag?=?false;
????????????}
????????????if(attr=="opacity"){
????????????????obj.style.filter?=?'alpha(opacity:'+typeValue+speed+')';
????????????????obj.style[attr]?=?(typeValue+speed)/100;
????????????}
????????????else
????????????????obj.style[attr]?=?typeValue+speed+"px";
????????}
????????if(flag){
????????????console.info("flag:"+flag);
????????????clearInterval(obj.timer);
????????????if(fn){
????????????????fn();
????????????}
????????}
????},30);
}

這是我的移動(dòng)函數(shù),是可以實(shí)現(xiàn)你的效果

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

是不是你的運(yùn)動(dòng)函數(shù)的問(wèn)題,還有opcity:100對(duì)的嗎,按照課程里封裝的函數(shù)不應(yīng)該是opcity:1才是不透明嗎

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

不是啊,先是200/200,變成400/400,完成后再變成200/200,跟移入移出沒(méi)有關(guān)系吧,是鏈?zhǔn)竭\(yùn)動(dòng),完成變大變小的~~


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

以為你沒(méi)有寫(xiě)移出的操作啊。只寫(xiě)了onmouseover你的onmouseout呢

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

舉報(bào)

0/150
提交
取消

為什么div的大小不能還原成200/200,請(qǐng)幫忙看下,TKS~!

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

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

幫助反饋 APP下載

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

公眾號(hào)

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