h5判断是否为iphonex
js移动端页面判断是否是iphoneX
转自https://blog.csdn.net/weixin_39924326/article/details/80352929
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 } } }