js 判断iphoneX

判断是不是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)