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