📜  获取窗口分辨率 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:20.977000             🧑  作者: 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);