当前位置 : 主页 > 网络编程 > JavaScript >

判断iPhoneX

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt if (/iphone/gi.test(navigator.userAgent) (screen.availWidth === 375) (screen.availHeight === 812)) { alert('iPhoneX') if ((window.innerHeight == '375') (window.innerWidth == '812')) { alert('水平摆放') } else { alert('垂直
gistfile1.txt
if (/iphone/gi.test(navigator.userAgent) && (screen.availWidth === 375) && (screen.availHeight === 812)) {
  alert('iPhoneX')
  if ((window.innerHeight == '375') && (window.innerWidth == '812')) {
    alert('水平摆放')
  } else {
    alert('垂直摆放')
  }
}
网友评论