-
Notifications
You must be signed in to change notification settings - Fork 129
/
Copy pathpagewalkthrough.js
115 lines (110 loc) · 3.04 KB
/
pagewalkthrough.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
$(document).ready(function() {
var cookie='cookie_pagewalkthrough';
var expire=3650;
//$.cookie(cookie,0,{expires: expire});
var count=$.cookie(cookie);
var showCount=2;
if(count>showCount) return false;
// Set up tour
$('body').pagewalkthrough({
name: 'introduction',
steps: [{
popup: {
content: '#walkthrough-1',
type: 'modal',
}
}, {
wrapper: '#walkthrough_1',
popup: {
content: '#walkthrough-2',
type: 'tooltip',
position: 'right'
},
onEnter: function(){
$('#walkthrough_1').addClass('active');
$('#walkthrough_1 > ul').css('display','block');
},
onLeave: function(){
$('#walkthrough_1').removeClass('active');
$('#walkthrough_1 > ul').css('display','none');
},
}, {
wrapper: '#walkthrough_2',
popup: {
content: '#walkthrough-3',
type: 'tooltip',
position: 'right'
},
onEnter: function(){
$('#walkthrough_2').addClass('active');
$('#walkthrough_2 > ul').css('display','block');
},
onLeave: function(){
$('#walkthrough_2').removeClass('active');
$('#walkthrough_2 > ul').css('display','none');
},
}, {
wrapper: '#walkthrough_4',
popup: {
content: '#walkthrough-5',
type: 'tooltip',
position: 'right'
},
onEnter: function(){
$('#walkthrough_4').addClass('active');
$('#walkthrough_4 > ul').css('display','block');
},
onLeave: function(){
$('#walkthrough_4').removeClass('active');
$('#walkthrough_4 > ul').css('display','none');
},
}, {
wrapper: '#walkthrough_3',
popup: {
content: '#walkthrough-4',
type: 'tooltip',
position: 'right'
},
onEnter: function(){
$('#walkthrough_3').addClass('active');
$('#walkthrough_3 > ul').css('display','block');
},
onLeave: function(){
$('#walkthrough_3').removeClass('active');
$('#walkthrough_3 > ul').css('display','none');
},
}, {
wrapper: '#walkthrough_90001',
popup: {
content: '#walkthrough-6',
type: 'tooltip',
position: 'right'
},
onEnter: function(){
$('#walkthrough_90001').addClass('active');
$('#walkthrough_90001 > ul').css('display','block');
},
onLeave: function(){
$('#walkthrough_90001').removeClass('active');
$('#walkthrough_90001 > ul').css('display','none');
},
}]
});
// Show the tour
$('body').pagewalkthrough('show');
if(count<=showCount){
count++;
$.cookie(cookie,count,{expires: expire});
}else{
$.cookie(cookie,1,{expires: expire});
}
});
var closePagewalkthrough= function () {
$.cookie('cookie_pagewalkthrough',11,{expires: 3650});
pageNotify('success','已关闭引导流程');
$.pagewalkthrough('close');
}
var openPagewalkthrouph=function(){
$.cookie('cookie_pagewalkthrough',0,{expires: 3650});
$('body').pagewalkthrough('show');
}