forked from ngzhian/multi-step-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
148 lines (148 loc) · 6.06 KB
/
index.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<style>
.m-progress-bar {
min-height: 1em;
background: #c12d2d;
width: 5%;
}
</style>
</head>
<body>
<form class="modal multi-step" id="demo-modal-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title step-1" data-step="1">Step 1</h4>
<h4 class="modal-title step-2" data-step="2">Step 2</h4>
</div>
<div class="modal-body step step-1">
This is step 1.
</div>
<div class="modal-body step step-2">
This is the final step
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary step step-1" data-step="1" onclick="sendEvent('#demo-modal-1', 2)">Continue</button>
</div>
</div>
</div>
</form>
<form class="modal multi-step" id="demo-modal-2">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title step-1" data-step="1">Step 1</h4>
<h4 class="modal-title step-2" data-step="2">Step 2</h4>
<h4 class="modal-title step-3" data-step="3">Final Step</h4>
<div class="m-progress">
<div class="m-progress-bar-wrapper">
<div class="m-progress-bar">
</div>
</div>
<div class="m-progress-stats">
<span class="m-progress-current">
</span>
/
<span class="m-progress-total">
</span>
</div>
<div class="m-progress-complete">
Completed
</div>
</div>
</div>
<div class="modal-body step-1" data-step="1">
This is step 1.
</div>
<div class="modal-body step-2" data-step="3">
This is the second step.
</div>
<div class="modal-body step-3" data-step="3">
This is the final step.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary step step-1" data-step="1" onclick="sendEvent('#demo-modal-2', 2)">Continue</button>
<button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-2', 3)">Continue</button>
</div>
</div>
</div>
</form>
<form class="modal multi-step" id="demo-modal-3">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title step-1" data-step="1">Step 1</h4>
<h4 class="modal-title step-2" data-step="2">Step 2</h4>
<h4 class="modal-title step-3" data-step="3">Final Step</h4>
<div class="m-progress">
<div class="m-progress-bar-wrapper">
<div class="m-progress-bar">
</div>
</div>
<div class="m-progress-stats">
<span class="m-progress-current">
</span>
/
<span class="m-progress-total">
</span>
</div>
<div class="m-progress-complete">
Completed
</div>
</div>
</div>
<div class="modal-body step-1" data-step="1">
This is step 1.
</div>
<div class="modal-body step-2" data-step="2">
This is the second step.
</div>
<div class="modal-body step-3" data-step="3">
This is the final step.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Back</button>
<button type="button" class="btn btn-primary step step-1" data-step="1" onclick="sendEvent('#demo-modal-3', 2)">Continue</button>
<button type="button" class="btn btn-primary step step-3" data-step="3" onclick="sendEvent('#demo-modal-3', 2)">Back</button>
<button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button>
</div>
</div>
</div>
</form>
<div class="container">
<div class="row">
<h1>
Simple Multi-step modal
</h1>
<button class="btn btn-default" data-toggle="modal" data-target="#demo-modal-1">Show</button>
</div>
<div class="row">
<h1>
Progress bar and text Multi-step modal
</h1>
<button class="btn btn-default" data-toggle="modal" data-target="#demo-modal-2">Show</button>
</div>
<div class="row">
<h1>
Progress bar with back buttons
</h1>
<button class="btn btn-default" data-toggle="modal" data-target="#demo-modal-3">Show</button>
</div>
</div>
<script src="multi-step-modal.js"></script>
<script>
sendEvent = function(sel, step) {
$(sel).trigger('next.m.' + step);
}
</script>
</body>
</html>