js--判断当前环境是否为iphonex环境
/** * 判断是否是iphonex */ function getIsIphonex () { var u = navigator.userAgent; var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); if (isIOS) { if (screen.height == 812 && screen.width == 375) { return true; } else { return false; } } };