📜  js 知道显示的屏幕大小 - Javascript 代码示例

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