📌  相关文章
📜  如何在javascript代码示例中获取窗口的大小

📅  最后修改于: 2022-03-11 15:02:05.949000             🧑  作者: Mango

代码示例2
var win = window,
    doc = document,
    docElem = doc.documentElement,
    body = doc.getElementsByTagName('body')[0],
    x = win.innerWidth || docElem.clientWidth || body.clientWidth,
    y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;
alert(x + ' × ' + y);