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

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

jquery 如何獲得窗口的寬和高

jquery 如何獲得窗口的寬和高

慕斯王 2018-11-26 05:00:29
jquery 如何獲得窗口的寬和高
查看完整描述

1 回答

?
慕尼黑8549860

TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超11個(gè)贊

提供你一個(gè)函數(shù),獲取瀏覽器顯示部分的高度,兼容所有主流瀏覽器
<script>
function getWindowSize() {
var client = {
x:0,
y:0
};

if(typeof document.compatMode != 'undefined' && document.compatMode == 'CSS1Compat') {
client.x = document.documentElement.clientWidth;
client.y = document.documentElement.clientHeight;
} else if(typeof document.body != 'undefined' && (document.body.scrollLeft || document.body.scrollTop)) {
client.x = document.body.clientWidth;
client.y = document.body.clientHeight;
}

return client;
}

function getsize(){
var size = getWindowSize();
document.getElementById("width").value = size.x;
document.getElementById("height").value = size.y;
}
</script>

<body onresize="getsize()">
width:<input type="text" id="width" /><br />
height:<input type="text" id="height" />
</body>



查看完整回答
反對(duì) 回復(fù) 2018-12-21
  • 1 回答
  • 0 關(guān)注
  • 537 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)