課程
/前端開發(fā)
/JavaScript
/瀑布流布局
var oBoxW = oBoxs[1].offsetWith; console.log(oBoxW); 結(jié)果是 undefined ?為什么
2016-08-21
源自:瀑布流布局 2-3
正在回答
分給我吧
。。眼瞎了,自己把offsetWidth寫成offsetWith沒看出來,還檢查了老半天。。。
舉報(bào)
瀑布流布局是網(wǎng)站比較流行的一種布局方式,教你實(shí)現(xiàn)三大方式
1 回答var cols = Math.floor(document.documentElement.clientWidth/oBoxW); console.log(cols); //設(shè)置main的寬度 oParent.style.cssText = 'width:' + oBoxW*cols + 'px;margin:0 auto';
2 回答var oboxw=oboxs[0].offsetwidth;
1 回答var oBoxW = oBoxs[0].offsetWidth;報(bào)錯(cuò)
4 回答oParent.style.cssText = 'width:' + oBoxW*cols +'px;margin:0 auto';在瀏覽器里沒有效果,console.log()也沒有輸出內(nèi)容,有人知道這是怎么回事嗎?
3 回答console.log()
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-09-02
分給我吧
2016-08-21
。。眼瞎了,自己把offsetWidth寫成offsetWith沒看出來,還檢查了老半天。。。