var isIOS = /(iPhone|iPad|iPod)/i.test(navigator.userAgent)
var isiPad = navigator.userAgent.match(/(iPad)/) || (navigator.platform === ‘MacIntel’ && navigator.maxTouchPoints > 1)
上面这个不行的话,再试下这个
var isiPad = (navigator.userAgent.match(/(iPad)/) || (navigator.userAgent.match(/(Macintosh)/) && navigator.maxTouchPoints >= 1));
var isAndroid = /Android/i.test(navigator.userAgent)
var isMobileDevice = navigator.userAgent.match(
/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i
);
【js判断机型】
于 2024-06-18 12:26:39 首次发布