window.devicePixelRatio = window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI;
window.devicePixelRatio = Math.round(window.devicePixelRatio * 100) / 100;
if(navigator.userAgent.indexOf("MSIE") > 0) {
    //IE 浏览器
    document.write(Math.round(window.screen.width * window.devicePixelRatio) + "×" + Math.round(window.screen.height * window.devicePixelRatio));
}
else {
    //非 IE 浏览器
    document.write(parseInt(window.screen.width * window.devicePixelRatio) + "×" + parseInt(window.screen.height * window.devicePixelRatio));
}

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用*标注