JS:判断是否是移动端

通过User-Agent判断

image

代码:

if(navigator.userAgent.match(/mobile/i)) {  
   //业务层代码
     $('body').removeClass("sidebar-open"); 
 }

猜你喜欢

转载自www.cnblogs.com/huiy/p/9120907.html