forked from kujian/weixinTip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
weixinTip-jq.html
50 lines (49 loc) · 1.52 KB
/
weixinTip-jq.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>微信弹出遮罩</title>
</head>
<body>
<style type="text/css">
*{margin:0; padding:0;}
img{max-width: 100%; height: auto;}
.test{height: 600px; max-width: 600px; font-size: 40px;}
</style>
<div class="test"><a href="http://mp.weixin.qq.com/mp/redirect?url=http://mobile.xinlianwang.com/android/distributor/DistributorApp.apk#weixin.qq.com#wechat_redirect ">有效跳转</a></div>
<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript">
function is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
var isWeixin = is_weixin();
var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
var weixinTip = $('<div id="weixinTip"><p><img src="live_weixin.png" alt="微信打开"/></p></div>');
if(isWeixin){
$("body").append(weixinTip);
}
$("#weixinTip").css({
"position":"fixed",
"left":"0",
"top":"0",
"height":winHeight,
"width":"100%",
"z-index":"1000",
"background-color":"rgba(0,0,0,0.8)",
"filter":"alpha(opacity=80)",
});
$("#weixinTip p").css({
"text-align":"center",
"margin-top":"10%",
"padding-left":"5%",
"padding-right":"5%"
});
</script>
</body>
</html>