-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh5_game_common.js
52 lines (45 loc) · 1.21 KB
/
h5_game_common.js
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
var $maskRule = $("#mask-rule"),//规则遮罩层
$mask = $("#mask"),//红包遮罩层
$winning = $(".winning"),//红包
$card = $("#card"),
$close = $("#close");
//link = false;//判断是否在链接跳转中
//规则
$(".rule").click(function () {
$maskRule.show();
});
$("#close-rule").click(function () {
$maskRule.hide();
});
/*中奖信息提示*/
function win() {
//遮罩层显示
$mask.show();
$winning.addClass("reback");
setTimeout(function () {
$card.addClass("pull");
}, 500);
//关闭弹出层
$("#close,.win,.btn").click(function () {
//$close.click(function () {
$mask.hide();
$winning.removeClass("reback");
$card.removeClass("pull");
});
/*$(".win,.btn").click(function () {
link = true;
});*/
}
//此处可以在commonjs中合并
function queryString(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results === null) {
return "";
}
else {
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
}