首页 > 技术文章 > js判断是否在微信浏览器打开

wang715100018066 2017-10-18 14:29 原文

没有在微信浏览器打开的时候:

 

用浏览器打开后

 

在这里需要判断箭头是否显示:

var arrows = document.getElementById("arrows");
function is_weixn(){  
    var ua = navigator.userAgent.toLowerCase();  
    if(ua.match(/MicroMessenger/i)=="micromessenger") {  
      //在微信浏览器 arrows.style.display
="block"; } else { arrows.style.display="none"; } } is_weixn();

 

推荐阅读