js 判断iphoneX

2018-07-18  本文已影响0人  Fv_8ea2

判断是不是iphoneX

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

判断是不是全面屏

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

猜你喜欢

热点阅读