国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

瀏覽器縮放檢測的js代碼

2019-11-20 14:05:14
字體:
來源:轉載
供稿:網友

測試代碼

http://jsbin.com/dipijeqi/11


效果:


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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 同江市| 依安县| 页游| 剑阁县| 云和县| 北川| 永丰县| 蒙阴县| 连平县| 驻马店市| 三门峡市| 伊川县| 泰宁县| 甘肃省| 新野县| 灵石县| 临安市| 寿阳县| 钦州市| 高碑店市| 云阳县| 新乐市| 湘潭市| 定西市| 齐齐哈尔市| 长汀县| 和平县| 渝中区| 迁安市| 灵武市| 临泽县| 洛隆县| 南郑县| 柳林县| 寿阳县| 重庆市| 满城县| 海兴县| 平舆县| 弥渡县| 运城市|