jquery 判断 移动设备
场景:Jquery 判断是不是 移动设备 浏览
Jquery 判断是否 移动设备 浏览
Jquery 判断是否 移动设备 浏览
$(document).ready(function() { var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i) ? true : false; }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i) ? true : false; }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false; }, Windows: function() { return navigator.userAgent.match(/IEMobile/i) ? true : false; }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows()); } }; if( isMobile.any() ) { $('.main_header').hide(); } });
判断是否为移动设备 在浏览内容