美文网首页
js 判断iphoneX

js 判断iphoneX

作者: Fv_8ea2 | 来源:发表于2018-07-18 15:48 被阅读0次

判断是不是iphoneX

function isIphoneX(){
    return /iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375)
}

判断是不是全面屏

function isAllScreen(){
  return screen.height/screen.width >16/9;
}

相关文章

网友评论

      本文标题:js 判断iphoneX

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