美文网首页
js判断iPhone X系列刘海头

js判断iPhone X系列刘海头

作者: 浪浪山小妖_ | 来源:发表于2020-05-22 21:10 被阅读0次
//判断是否刘海头
const isIphoneX = () => {
  if (typeof window !== 'undefined' && window) {
      return /iphone/gi.test(window.navigator.userAgent) && window.screen.height >= 812;
  }
  return false;
};

--by Affandi ⊙▽⊙

相关文章

网友评论

      本文标题:js判断iPhone X系列刘海头

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