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

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

為什么CHROME報(bào)錯(cuò)說(shuō)Uncaught TypeError: Cannot read property 'currentStyle' of undefined

function getStyle(obj,attr) {

if (obj.currentStyle) {

return obj.currentStyle[attr];

}

else{

return getComputedStyle(obj,false)[attr];

? ? }

}


function startMove(obj,json,fn) {

var flag = true ;?

clearInterval(obj.timer);

obj.timer=setInterval(function () {

for(var attr in json) {

//取當(dāng)前值

var icur = 0;

if(attr=='opacity') {

icur=Math.round(parseFloat(getStyle(obj,attr))*100);

}

else{

icur=parseInt(getStyle(obj.attr));

}

//計(jì)算速度

var ispeed=(json[attr]-icur)/8;

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

//檢測(cè)停止

if(icur!=json[attr]) {

flag=false;

}

if(attr=='opacity') {

? ? ? ? ? ? ? ? obj.style.filter='alpha(opacity:'+(icur+ispeed)+')';

? ? ? ? ? ? ? ? obj.style.opacity=(icur+ispeed)/100;

}

? ? ? ? ? ? else{

? ? ? ? ? ? obj.style[attr]=icur+ispeed+'px';

? ? ? ? ? ? } ? ?

}

if(flag){

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

? ? ? ? ? ? if(fn){

? ? ? ? ? ? fn();

? ? ? ? ? ? }

? ? ? ? ? ? }

},30);

}


正在回答

1 回答

不知道,我有沒(méi)有看錯(cuò);

obj.attr 而不是obj, attr;?

點(diǎn)逗號(hào);

一個(gè)傳參數(shù),一個(gè)查屬性


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

Redchan 提問(wèn)者

非常感謝!
2016-04-20 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么CHROME報(bào)錯(cuò)說(shuō)Uncaught TypeError: Cannot read property 'currentStyle' of undefined

我要回答 關(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)