判断iphonex

$(document).ready(function() {

function isIphoneX() {

return /iphone/gi.test(navigator.userAgent) && (screen.height >= 812 && screen.width >= 375)

}

if(isIphoneX()) {

$("#hedswp").css("height", "35%");

//$(".ma").css("top", "72.2%");

}

var ua = navigator.userAgent.toLowerCase();

var isWeixin = ua.indexOf('micromessenger') != -1;

var isAndroid = ua.indexOf('android') != -1;

var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);

/*if(!isWeixin) {

document.head.innerHTML = '抱歉,出错了';

document.body.innerHTML = '

请在微信客户端打开链接

';

}*/

});

你可能感兴趣的:(判断iphonex)