足球游戏_中国足彩网¥体育资讯$

浏览器缩放检测的js代码
来源:易贤网 阅读:1920 次 日期:2014-09-29 10:59:25
温馨提示:易贤网小编为您整理了“浏览器缩放检测的js代码”,方便广大网友查阅!

效果:

chrome

代码如下:

window.devicePixelRatio : 2 (准确)

screen.deviceXDPI / screen.logicalXDPI : NaN

window.outerWidth / window.innerWidth : 2

document.documentElement.offsetHeight / window.innerHeight : 0.020618556701030927 (有相关性)

window.top.outerWidth / window.top.innerWidth : 2

ff

代码如下:

window.devicePixelRatio : 1.5 (准确)

screen.deviceXDPI / screen.logicalXDPI : NaN

window.outerWidth / window.innerWidth : 1.0114583333333333

document.documentElement.offsetHeight / window.innerHeight : 0.023391812865497075 (有相关性)

window.top.outerWidth / window.top.innerWidth : 1.0114583333333333

ie 8

代码如下:

window.devicePixelRatio : undefined

screen.deviceXDPI / screen.logicalXDPI : 1.5416666666666667 (大致准确)

window.outerWidth / window.innerWidth : NaN

document.documentElement.offsetHeight / window.innerHeight : NaN

window.top.outerWidth / window.top.innerWidth : NaN

ie11

代码如下:

window.devicePixelRatio : 1.5 (准确)

screen.deviceXDPI / screen.logicalXDPI : 1.5

window.outerWidth / window.innerWidth : 1.0084033613445377

document.documentElement.offsetHeight / window.innerHeight : 0.02203856749311295 (有相关性)

window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

ie10

代码如下:

window.devicePixelRatio : undefined

screen.deviceXDPI / screen.logicalXDPI : 1.5 (准确)

window.outerWidth / window.innerWidth : 1.0084033613445377

document.documentElement.offsetHeight / window.innerHeight : 1

window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

ie9

代码如下:

window.devicePixelRatio : undefined

screen.deviceXDPI / screen.logicalXDPI : 1.5 (准确)

window.outerWidth / window.innerWidth : 1.0084033613445377

document.documentElement.offsetHeight / window.innerHeight : 1

window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

360 6.3(完全没反应)

代码如下:

window.devicePixelRatio : undefined

screen.deviceXDPI / screen.logicalXDPI : 1

window.outerWidth / window.innerWidth : NaN

document.documentElement.offsetHeight / window.innerHeight : NaN

window.top.outerWidth / window.top.innerWidth : NaN

360极速浏览器

代码如下:

window.devicePixelRatio : 1

screen.deviceXDPI / screen.logicalXDPI : NaN

window.outerWidth / window.innerWidth : 1.5

document.documentElement.offsetHeight / window.innerHeight : 0.015267175572519083

window.top.outerWidth / window.top.innerWidth : 1.5(准确)

搜狗高速浏览器 (完全没反应)

代码如下:

window.devicePixelRatio : undefined

screen.deviceXDPI / screen.logicalXDPI : 1

window.outerWidth / window.innerWidth : NaN

document.documentElement.offsetHeight / window.innerHeight : NaN

window.top.outerWidth / window.top.innerWidth : NaN

淘宝浏览器

代码如下:

window.devicePixelRatio : 1

screen.deviceXDPI / screen.logicalXDPI : NaN

window.outerWidth / window.innerWidth : 2.0710059171597632 (大致准确)

document.documentElement.offsetHeight / window.innerHeight : 0.022988505747126436

window.top.outerWidth / window.top.innerWidth : 2.0710059171597632

中国足彩网信息请查看IT技术专栏

中国足彩网信息请查看脚本栏目
易贤网手机网站地址:浏览器缩放检测的js代码
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 新媒体/短视频平台 | 手机站点

版权所有:易贤网