Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

测试地址一:(测试成功)
http://bbs2.valueonline.cn/we...

测试地址二:(测试失败)
http://bbs2.valueonline.cn/we...

判断是否是微信浏览器的代码:

<script type="text/javascript">
$(function(){
    //判断是否是微信
    var is_weixn=( function(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger"){
            return true;
        }
        else{
            $(".header").removeClass("hide");
            $(".footerMeumBox").hide();
            return false;
        }
    })()
})
</script>

想要达到的效果:(微信浏览器中不显示头部导航,普通浏览器中不显示底部导航)

clipboard.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
465 views
Welcome To Ask or Share your Answers For Others

1 Answer

**你确定是同一份代码吗
一份代码放在$(function(){})里,一份不放,当然不放的那一份,在执行的时候找不到$(".footerMeumBox")**


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...