js判断微信 选择浏览器打开

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
body{
font-family: 微软雅黑;
margin: 0;

}
body a{
display: block;
text-decoration: none;
text-align: center;
}
#a{
font-family: 微软雅黑;
background: url("images/e.jpg");
background-size: 100%;
overflow: hidden;
height: 100vh;
display: none !important;
}
.top{
margin-top: 50em;
}
.b{
margin-top: 4em;
}
.tishi{

display: block;
height: 100vh;
text-align: right;
background: url("images/h.jpg");
background-size: 100%;
background-position: top center;
/*display: none;*/
}
.tishi img{

display: inline-block;
40%;
}

</style>
</head>
<body>
<script type="text/javascript">
window.onload=function is_weixin(){
var xia=document.getElementById('a');
var zip= document.getElementById('ti');
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)=="micromessenger") {
zip.style.display="block";
return true;
} else {
xia.style.display="block";
return false;
}
}

</script>
<div class="zip" id="a">
<a href="" class="top">
<img src="images/c.png">
</a>

<a class="b" href="">
<img src="images/b.png">
</a>
</div>

<a class="tishi" id="ti" href="">
<img src="images/d.png">
</a>



</body>
</html>

原文地址:https://www.cnblogs.com/gxw123/p/7601727.html