-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.html
212 lines (163 loc) · 5.98 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Popbox.js demo</title>
<meta name="description" content="Popbox.js is a tiny javascript plugin for creating stackable modals">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Popbox.js"/>
<meta property="og:image" content="https://oncebot.github.io/popbox.js/meta.png"/>
<meta property="og:site_name" content="popbox.js"/>
<meta property="og:description" content="Popbox.js is a tiny javascript plugin for creating stackable modals"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<link rel="stylesheet" type="text/css" href="popbox/popbox.css">
<link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
<div data-popbox-id="modal1" class="popbox">
<div class="popbox_container">
<p class="heading"><strong>Modal 1</strong></p>
<p class="text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat iusto vitae adipisci, fuga exercitationem eum alias sit accusantium nisi. Qui assumenda alias fuga delectus odit soluta reprehenderit aut sint veniam!
</p>
<button data-popbox-close="modal1" class="danger">Close</button>
<button data-popbox-target="modal2">Open another</button>
</div>
</div>
<div data-popbox-id="modal2" class="popbox">
<div class="popbox_container">
<p class="text">
<img src="img.jpg">
</p>
<div class="footer">
<button data-popbox-close="modal2" class="danger">Close</button>
<button data-popbox-target="modal3">Open another</button>
</div>
</div>
</div>
<div data-popbox-id="modal3" class="popbox">
<div class="popbox_container">
<p class="heading"><strong>Login</strong></p>
<form autocomplete="off">
<div>
<input type="email" name="Formemail">
</div>
<div>
<input type="password" name="Formpass">
</div>
</form>
<button data-popbox-close="modal3" class="danger">Close</button>
<button data-popbox-target="modal1">Open First</button>
</div>
</div>
<div class="popbox_main_content">
<div class="wrapper">
<div class="card">
<div class="card_title">
Popbox.js
<div class="small" style="margin-top: 10px;">Popbox.js is a tiny javascript plugin for creating stackable modals</div>
<div class="small">It is fully customizable and dependency free.</div>
<div><a href="https://github.com/oncebot/popbox.js" target="_blank" class="button getBtn">Get it</a></div>
</div>
<div class="card_content">
<button data-popbox-target="modal1">Open Popbox Modal</button>
<pre><code>
<strong>Installation</strong>
<br>
<br>
<ol>
<li>Add the popbox.css file to the head of your html.</li>
<li>Add the popbox.js file to the head of your html or right before the closing body tag.</li>
<li>Add this code after the popbox.js script tag to initialize the plugin.<br>
<textarea disabled>
<script type="text/javascript">
var popbox =   new Popbox({
    blur:true,
  });
</script>
</textarea>
</li>
</ol>
</code></pre>
<pre><code>
<strong>Example html</strong>
<br>
<br>
<textarea disabled style="min-height: 550px;">
  <div data-popbox-id="mypopbox1" class="popbox">
  <div class="popbox_container">
    Popbox content 1
    <button data-popbox-close="mypopbox1">Close</button>
  </div>
  </div>
  <div data-popbox-id="mypopbox2" class="popbox">
  <div class="popbox_container">
    Popbox content 2
  </div>
    <button data-popbox-close="mypopbox2">Close</button>
  </div>
  <div class="popbox_main_content">
    Main content of the page
    <button data-popbox-target="mypopbox1">
    Open mypopbox 1
    </button>
    <button data-popbox-target="mypopbox2">
    Open mypopbox 2
    </button>
  </div>
</textarea>
</code></pre>
<pre><code>
<strong>Options</strong>
<br>
<br>
<ol>
<li>blur : set it to true for blur effect on the main content (Default:false)</li>
</li>
</ol>
</code></pre>
<pre><code>
<strong>API</strong>
<br>
<br>
Open and close popbox with api
<textarea disabled style="min-height: 300px;">
<script type="text/javascript">
var popbox =   new Popbox({
    blur:true,
  });
//open a popbox
popbox.open('mypopbox1');
//close a popbox
popbox.close('mypopbox1');
//close all popboxes
popbox.clear();
</script>
</textarea>
</code></pre>
<pre><code>
<strong>Emitted events</strong>
<br>
<br>
<p>'popbox_opening': when a popbox is opening, that popbox element will emit this event.</p>
<p>'popbox_opened': when a popbox is opened, that popbox element will emit this event.</p>
<p>'popbox_closing': when a popbox is closing, that popbox element will emit this event.</p>
<p>'popbox_closed': when a popbox is closed, that popbox element will emit this event.</p>
</code></pre>
</div>
</div>
<div style="text-align: center; font-size: 12px; margin-bottom: 15px;"><a href="https://oncebot.com" target="_blank">oncebot.com</a></div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="popbox/popbox.js"></script>
<script type="text/javascript">
var popbox = new Popbox({
blur:true,
});
</script>
</body>
</html>