js判断微信打开提示在浏览器打开代码

winniephp winniephp 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
	
<style type="text/css">
*{margin:0; padding:0;}
a{text-decoration: none;}
img{max-width: 100%; height: auto;}
.weixin-tip{display: none; position: fixed; left:0; top:0; bottom:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); height: 100%; width: 100%; z-index: 100;}
.weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}
</style>

<div class="weixin-tip">
<p>
<img src="live_weixin.png" alt="在浏览器打开"/>
</p>
</div>
<script type="text/javascript">



$(window).on("load",function(){
var winHeight = $(window).height();
function is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
var isWeixin = is_weixin();
if(isWeixin){
$(".weixin-tip").css("height",winHeight);
$(".weixin-tip").show();
}
})
</script>



以上代码默认在微信打开就提示“在浏览器打开”,
那如何改为在
<article class="content">
</article>
里面所有链接,点击就提示用浏览器打开,不点击就不提示呢?
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
winniephp
JavaScript 87,984 成员 224,680 内容