美文网首页
js判断是否是iphone x

js判断是否是iphone x

作者: Hi小胡 | 来源:发表于2019-07-30 19:08 被阅读0次
机型 倍率 分辨率 pt
iPhone X 3 2436 × 1125 812 × 375
iPhone XS 3 2436 × 1125 812 × 375
iPhone XS Max 3 2688 × 1242 896 × 414
iPhone XR 2 1792 × 828 896 × 414
function isIphoneX() {
    return ((/iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375)) || (/iphone/gi.test(navigator.userAgent) && (screen.height == 896 && screen.width == 414)))
}

相关文章

网友评论

      本文标题:js判断是否是iphone x

      本文链接:https://www.haomeiwen.com/subject/halorctx.html