web页在微信中访问增加遮罩层 右上角弹出在浏览器中打开

编程入门 行业动态 更新时间:2024-10-04 13:33:16

web页在微信中访问增加遮罩层 右上角弹出在浏览器中打开

<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="images/tip.png" alt="在浏览器打开" />
		</p>
	</div>
<script>
	$(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>

DEMO下载地址

更多推荐

web页在微信中访问增加遮罩层 右上角弹出在浏览器中打开

本文发布于:2023-06-14 01:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422216.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出   信中   器中   web   遮罩层

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!