移动开发JS:判断是否是移动端 云博小周宇2024年5月5日2023年8月23日1 Min Read 通过User-Agent判断 代码: if(navigator.userAgent.match(/mobile/i)) { //业务层代码 $(‘body‘).removeClass("sidebar-open"); }