判断是否为iphoneX

    isIphoneX () {
      let result = false
      let u = navigator.userAgent
      let isIos = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
      if (isIos) {
        if (screen.height === 812 && screen.width === 375) {
          result = true
        }
      }
      return result
    }

  

posted on 2019-03-08 14:47  木之子梦之蝶  阅读(461)  评论(0编辑  收藏  举报

导航