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

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

js動(dòng)畫,邊框?qū)挾冗_(dá)不到目標(biāo)值,運(yùn)行結(jié)果總是比目標(biāo)值小7.

js動(dòng)畫,邊框?qū)挾冗_(dá)不到目標(biāo)值,運(yùn)行結(jié)果總是比目標(biāo)值小7.

kx00012kx 2016-08-13 09:30:18
<!doctype?html> <html> <head> <meta?charset="utf-8"> <title>多物體運(yùn)動(dòng)</title> <style> *{list-style:none;margin:0px;padding:0px;} ul?li{width:200px; ??height:100px; ??background:yellow; ??margin:50px?auto; ??border:#000000?solid?1px; ??filter:alpha(opacity:30); ??opacity:0.3; ??} </style> <script> window.onload=function(){ var?li1=document.getElementById('li1') li1.onmouseover=function(){ startMove(li1,{'width':400,'height':200,opacity:100,borderWidth:50}) } li1.onmouseout=function(){ startMove(li1,{'width':200,'height':100,opacity:30,borderWidth:1}) } } //var?alpha=30 function?startMove(obj,json,fn){ clearInterval(obj.timer) obj.timer=setInterval(function(){ //var?icur=0 var?flag=true for(var?attr?in?json){ if(attr=='opacity'){ var?icur=Math.round(parseFloat(getStyle(obj,[attr]))*100) } else{ var?icur=parseInt(getStyle(obj,[attr])) } var?speed=(json[attr]-icur)/8 speed=speed>0?Math.ceil(speed):Math.floor(speed) if(icur?!=?json[attr]){ flag=false; } if(attr=='opacity'){ obj.style.filter='alpha(opacity:'+(icur+speed)+')' obj.style.opacity=(icur+speed)/100; } else{ obj.style[attr]=icur+speed+'px'; } } if(flag){ clearInterval(obj.timer) if(fn){fn()} } },50) } function?getStyle(obj,attr){ if(obj.currentStyle){ return?obj.currentStyle[attr] } else{ return?getComputedStyle(obj,false)[attr] } } </script> </head> <body> <ul> <li?id="li1"></li> </ul> </body> </html>當(dāng)邊框的目標(biāo)寬度大于8時(shí),運(yùn)行結(jié)果總是比目標(biāo)寬度小7;當(dāng)邊框的目標(biāo)寬度小于等于8時(shí),即使原始寬度不是1,運(yùn)行結(jié)果也總是回變成1;導(dǎo)致這個(gè)bug的原因是什么額,求大神解答?
查看完整描述

目前暫無(wú)任何回答

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

添加回答

舉報(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)