function isIPhoneX(fn){
var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isIOS) {
if (screen.height == 812 && screen.width == 375){
//是iphoneX
}else{
//不是iphoneX
}
}
}
大前端知识库收集分享 www.rjxgc.com 壹玖零Tech
搜罗各种前后端奇淫技巧,花式编程思想,日日更新,速来围观吧...
引用:https://blog.csdn.net/weixin_39924326/article/details/80352929
网友评论