国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 咸宁市| 湟中县| 永清县| 溧阳市| 台北县| 利津县| 商洛市| 涿州市| 景泰县| 米林县| 五台县| 滦南县| 黎川县| 平山县| 隆化县| 祁阳县| 偃师市| 赣州市| 曲阜市| 临猗县| 奎屯市| 柳河县| 达拉特旗| 上思县| 盘山县| 屯昌县| 平山县| 安平县| 呼伦贝尔市| 铅山县| 甘谷县| 新田县| 清河县| 尼玛县| 镇坪县| 固始县| 海晏县| 邹城市| 咸阳市| 大洼县| 通道|