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

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

?求大神幫忙完善框架

?求大神幫忙完善框架

慕九州7009252 2017-01-10 15:21:00
<!DOCTYPE?html> <html?lang="en"> <head> ????<meta?charset="UTF-8"> ????<title>Title</title> ????<style> ?#show?{width:?100px;height:?200px;?background:?#ccc;?display:?none;} ?#you{ ?width:?300px; ?height:?300px; ?background:?red; ????????} ????</style> ????<script> ?window.onload?=?function?()?{ ?//根據(jù)ID返回dom元素 ?var?$?=?function(id){return?document.getElementById(id);} ?//返回dom元素的當(dāng)前某css值 ?var?getCss?=?function(obj,name){ ?if(obj.currentStyle)?{//for?ie?; ?return?obj.currentStyle[name]; ????????????????}else?{?//?for?ff; ?var?style?=?document.defaultView.getComputedStyle(obj,null); ?return?style[name]; ????????????????} ????????????} ?var?show?=?function(obj,speed,fn){ ?obj?=?$(obj); ?if?(!speed)?{ ?obj.style.display?=?'block'; ?return; ????????????????} ?var?initH?=?0?,?initW?=?0; ?//獲取dom的寬與高 ?var?oWidth?=?getCss(obj,'width').replace('px',''),?oHeight?=?getCss(obj,'height').replace('px',''); ?//每次dom的遞減數(shù)(等比例) ?var?wcut?=?2*(+oWidth.replace('px','')?/?+oHeight.replace('px','')),hcut?=20; ?//處理動(dòng)畫函數(shù) ?var?process?=?function(){ ?obj.style.overflow?=?'hidden'; ?obj.style.display?=?'block'; ?initW?=?(initW+wcut)?>?oWidth???oWidth?:?initW+wcut; ?initH?=?(initH+hcut)?>?oHeight???oHeight?:?initH+hcut; ?//判斷是否減完了 ?if(initW?!==?oWidth?||?initH?!==?oHeight)?{ ?//obj.style.width?=?initW+'px'; ?obj.style.height?=?initH+'px'; ?setTimeout(function(){process();},speed); ????????????????????}else?{ ?//加完后,設(shè)置屬性為顯示以及原本dom的寬與高; ????????????????????????//obj.style.width?=?oWidth+'px'; ?obj.style.height?=?oHeight+'px'; ?if(fn){ ?fn(); ????????????????????????} ????????????????????} ????????????????} ?process(); ????????????} ?show('you',30,function?()?{ ?show('show',30) ????????????}); ????????} ????</script> </head> <body> <div?id="show"></div> ????<div?id="you"></div> </body> </html>因?yàn)槭切率?,從網(wǎng)上找到了這個(gè),但是這個(gè)不能設(shè)置obj的高或者寬變化,fn是我自己加的,但是發(fā)現(xiàn)第一次運(yùn)動(dòng)完以后要好長(zhǎng)時(shí)間才完成之后的運(yùn)動(dòng)。請(qǐng)高手幫我改改。
查看完整描述

1 回答

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

添加回答

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