亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

瀏覽器縮放檢測的js代碼

 更新時間:2014年09月28日 23:19:13   作者:99js  
這篇文章主要介紹了瀏覽器縮放檢測的js代碼,需要的朋友可以參考下

測試代碼

http://jsbin.com/dipijeqi/11


效果:


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

相關(guān)文章

  • uniapp介紹與使用以及小程序?qū)崟r獲取視頻播放時間

    uniapp介紹與使用以及小程序?qū)崟r獲取視頻播放時間

    這篇文章主要給大家介紹了關(guān)于uniapp介紹與使用以及小程序?qū)崟r獲取視頻播放時間的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用uniapp具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2023-02-02
  • bootstrap使用validate實現(xiàn)簡單校驗功能

    bootstrap使用validate實現(xiàn)簡單校驗功能

    這篇文章主要為大家詳細(xì)介紹了bootstrap使用validate實現(xiàn)簡單校驗功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-12-12
  • JavaScript實現(xiàn)table切換的插件封裝

    JavaScript實現(xiàn)table切換的插件封裝

    這篇文章主要為大家詳細(xì)介紹了JavaScript實現(xiàn)table切換的插件封裝,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-10-10
  • Add Formatted Text to a Word Document

    Add Formatted Text to a Word Document

    Add Formatted Text to a Word Document...
    2007-06-06
  • CSS(js)限制頁面顯示的文本字符長度

    CSS(js)限制頁面顯示的文本字符長度

    限制頁面顯示的字符長度,一直被眾多網(wǎng)友傾睬,本人也是一fans利用閑暇時間搜集整理了一些實用技巧,需要了解的朋友可以參考下
    2012-12-12
  • 原生JS實現(xiàn)幾個常用DOM操作API實例

    原生JS實現(xiàn)幾個常用DOM操作API實例

    下面小編就為大家?guī)硪黄鶭S實現(xiàn)幾個常用DOM操作API實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-01-01
  • js實現(xiàn)輪播圖效果 純js實現(xiàn)圖片自動切換

    js實現(xiàn)輪播圖效果 純js實現(xiàn)圖片自動切換

    這篇文章主要為大家詳細(xì)介紹了js實現(xiàn)輪播圖效果,圖片自動切換,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-08-08
  • js數(shù)組案例之五子棋游戲

    js數(shù)組案例之五子棋游戲

    這篇文章主要為大家詳細(xì)介紹了js數(shù)組案例之五子棋游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-05-05
  • Bootstrap每天必學(xué)之模態(tài)框(Modal)插件

    Bootstrap每天必學(xué)之模態(tài)框(Modal)插件

    Bootstrap每天必學(xué)之模態(tài)框(Modal)插件,模態(tài)框(Modal)是覆蓋在父窗體上的子窗體。通常,目的是顯示來自一個單獨的源的內(nèi)容,可以在不離開父窗體的情況下有一些互動。子窗體可提供信息、交互等,感興趣的小伙伴們可以參考一下
    2016-04-04
  • JavaScript中三種常見的排序方法

    JavaScript中三種常見的排序方法

    本篇文章主要介紹了JavaScript中三種常見的排序方法:快速排序、插入排序、冒泡排序,具有很好的參考價值,下面跟著小編一起來看下吧
    2017-02-02

最新評論