課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript進(jìn)階篇
這里的body指的是什么?
2016-07-22
源自:JavaScript進(jìn)階篇 9-19
正在回答
試試改成“document.documentElement.scrollHeight”
或者按下面的寫(xiě)法(適合不同瀏覽器兼容性)
var w=document.documentElement.scrollWidth?|| document.body.scrollWidth;
var h=document.documentElement.scrollHeight?|| document.body.scrollHeight;
因?yàn)闆](méi)有內(nèi)容吧?? 加個(gè)document.write("http://////"+"<br/>");就會(huì)顯示高度了
巾小尹 提問(wèn)者
舉報(bào)
本課程從如何插入JS代碼開(kāi)始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
2 回答為什么我的顯示是undefined?
4 回答為什么我的顯示是沒(méi)票
1 回答顯示為0???
2 回答為什么我的第一個(gè)顯示的是錯(cuò)的
4 回答為什么我顯示的是兩個(gè)彈窗?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-07-28
試試改成“document.documentElement.scrollHeight”
或者按下面的寫(xiě)法(適合不同瀏覽器兼容性)
var w=document.documentElement.scrollWidth?|| document.body.scrollWidth;
var h=document.documentElement.scrollHeight?|| document.body.scrollHeight;
2016-07-22
因?yàn)闆](méi)有內(nèi)容吧?? 加個(gè)document.write("http://////"+"<br/>");就會(huì)顯示高度了