window.isMobile = {
Android: function Android() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function BlackBerry() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function iOS() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function Opera() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function Windows() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function any() {
return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
}
};
window.isIE = /(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent);
window.windowHeight = window.innerHeight;
window.windowWidth = window.innerWidth;
js判断终端类型和浏览器类型
最新推荐文章于 2024-07-29 08:30:00 发布