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

首頁 > 語言 > JavaScript > 正文

瀏覽器縮放檢測的js代碼

2024-05-06 16:09:20
字體:
供稿:網(wǎng)友
這篇文章主要介紹了瀏覽器縮放檢測的js代碼,需要的朋友可以參考下

測試代碼


效果:


chrome

復(fù)制代碼 代碼如下:


window.devicePixelRatio : 2  (準(zhǔn)確)
screen.deviceXDPI / screen.logicalXDPI : NaN
window.outerWidth / window.innerWidth : 2
document.documentElement.offsetHeight / window.innerHeight : 0.020618556701030927 (有相關(guān)性)
window.top.outerWidth / window.top.innerWidth : 2

ff

復(fù)制代碼 代碼如下:


window.devicePixelRatio : 1.5 (準(zhǔn)確)
screen.deviceXDPI / screen.logicalXDPI : NaN
window.outerWidth / window.innerWidth : 1.0114583333333333
document.documentElement.offsetHeight / window.innerHeight : 0.023391812865497075  (有相關(guān)性)
window.top.outerWidth / window.top.innerWidth : 1.0114583333333333

ie 8

復(fù)制代碼 代碼如下:


window.devicePixelRatio : undefined
screen.deviceXDPI / screen.logicalXDPI : 1.5416666666666667 (大致準(zhǔn)確)
window.outerWidth / window.innerWidth : NaN
document.documentElement.offsetHeight / window.innerHeight : NaN
window.top.outerWidth / window.top.innerWidth : NaN

ie11

復(fù)制代碼 代碼如下:


window.devicePixelRatio : 1.5 (準(zhǔn)確)
screen.deviceXDPI / screen.logicalXDPI : 1.5
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 0.02203856749311295 (有相關(guān)性)
window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

ie10

復(fù)制代碼 代碼如下:


window.devicePixelRatio : undefined
screen.deviceXDPI / screen.logicalXDPI : 1.5 (準(zhǔn)確)
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 1
window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

ie9

復(fù)制代碼 代碼如下:


window.devicePixelRatio : undefined
screen.deviceXDPI / screen.logicalXDPI : 1.5 (準(zhǔn)確)
window.outerWidth / window.innerWidth : 1.0084033613445377
document.documentElement.offsetHeight / window.innerHeight : 1
window.top.outerWidth / window.top.innerWidth : 1.0084033613445377

360 6.3(完全沒反應(yīng))

復(fù)制代碼 代碼如下:


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極速瀏覽器

復(fù)制代碼 代碼如下:


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(準(zhǔn)確)

搜狗高速瀏覽器 (完全沒反應(yīng))

復(fù)制代碼 代碼如下:


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

淘寶瀏覽器

復(fù)制代碼 代碼如下:


window.devicePixelRatio : 1
screen.deviceXDPI / screen.logicalXDPI : NaN
window.outerWidth / window.innerWidth : 2.0710059171597632  (大致準(zhǔn)確)
document.documentElement.offsetHeight / window.innerHeight : 0.022988505747126436
window.top.outerWidth / window.top.innerWidth : 2.0710059171597632

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 东辽县| 象山县| 菏泽市| 册亨县| 仁化县| 新巴尔虎左旗| 顺义区| 富宁县| 武鸣县| 来安县| 余姚市| 蒙阴县| 个旧市| 祁门县| 溆浦县| 长垣县| 仙桃市| 大竹县| 永昌县| 林甸县| 商洛市| 银川市| 苏尼特左旗| 青冈县| 建始县| 喀什市| 漳浦县| 奉贤区| 沛县| 囊谦县| 老河口市| 读书| 公安县| 仁寿县| 阿拉尔市| 三穗县| 阳春市| 天峻县| 永泰县| 石泉县| 福州市|