首页 > 页面已经适配PC和移动端,请问如何设置是移动端时不执行某段js语句?

页面已经适配PC和移动端,请问如何设置是移动端时不执行某段js语句?

页面已经适配PC和移动端,请问如何设置移动端不执行某段js语句

忘记更新了,已经解决了,谢谢了,看到了张鑫旭大神的方法
地址http://www.zhangxinxu.com/wordpress/2016/06/pseudo-response-layout-base-on-screen-width/comment-page-1/#comment-319478


if(!(navigator.userAgent.match(/(iPhone|iPod|Android|ios|Windows Phone)/i))){
        //do_sth 
    }

可以尝试通过window.screen.width的值来判断,大多数手机都支持

【热门文章】
【热门文章】