-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathapi.html
313 lines (296 loc) · 8.55 KB
/
api.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Popelt - Modal Popup jQuery Plugin</title>
<link rel="stylesheet" href="css/normalize.css" />
<link rel="stylesheet" href="css/popelt.css" />
<link rel="stylesheet" href="css/demo.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="minified/popelt-v1.0.min.js"></script>
</head>
<body>
<div class="wrapper">
<h1>Popelt</h1>
<h3>Lightweight Modal Popup jQuery Plugin</h3>
<hr/>
<p>
Check: <a href="demo.html">Demo</a>
<a href="https://github.com/scazzy/Popelt">Github</a><br />
Download: <a href="https://github.com/scazzy/Popelt/blob/master/minified/popelt-v1.0.min.js">Minified</a><small>(5kb)</small> <a href="https://github.com/scazzy/Popelt/blob/master/source/popelt-v1.0-source.js">Source</a>
</p>
<hr/>
<div class="features">
<h3>Features</h3>
<ul>
<li>Modal</li>
<li>Responsive</li>
<li>Dyanmic Buttons</li>
<li>Dynamic content - <strong>Ajax</strong>, <strong>Iframe</strong>, or <strong>template</strong></li>
<li>First input focus</li>
<li>Dynamic positioning</li>
<li>Escape to close</li>
<li>Multiple / nested popups</li>
<li>Dynamic overlay background color and opacity</li>
<li>Simple to use</li>
<li>IE7+ compatibility</li>
<li>Extreme Lightweight (just ~5kb compressed)</li>
</ul>
</div>
<div class="features">
<h3>Example</h3>
<pre class="code">
var MyPopup = new popelt({
title: 'Pop some cash',
content: ''Hey wasup! This is my content.'
}).show();
</pre>
</div>
<div class="methods">
<h3>Methods</h3>
<table>
<tr>
<th>Method name</th>
<th>Parameters</th>
<th>Description</th>
</tr>
<tr>
<td>addButton</td>
<td>label [,class] [,clickEvent]</td>
<td>
<strong>label</strong> - Name on button<br />
<strong>class</strong> - custom class to give to the button [optional]<br />
<strong>clickEvent</strong> - Function to execute on click of button. If not provided, by default triggers popup close [optional]
</td>
</tr>
<tr>
<td>setContent</td>
<td>content</td>
<td>
<strong>content</strong> - Body content of the popup<br />
Can be HTML or Plain text
</td>
</tr>
<tr>
<td>show<br />
showPopup
</td>
<td>-</td>
<td>Show the popup</td>
</tr>
<tr>
<td>close<br />
closePopup<br />
</td>
<td>-</td>
<td>
Close the popup
</td>
</tr>
<tr>
<td>addOKButton</td>
<td>clickEvent</td>
<td>
Add a button with "OK" as label<br />
<strong>clickEvent</strong> - On click event
</td>
</tr>
<tr>
<td>addCloseButton</td>
<td>-</td>
<td>
Add a button with "Close" as label. It will close the popup
</td>
</tr>
<tr>
<td>addCancelButton</td>
<td>-</td>
<td>
Add a button with "Cancel" as label. It will close the popup
</td>
</tr>
</table>
</div>
<div class="methods">
<h3>Settings / Attributes</h3>
<table>
<tr>
<th>Setting</th>
<th>Values</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>modal</td>
<td>boolean</td>
<td>false</td>
<td><strong>true</strong> or <strong>false</strong></td>
</tr>
<tr>
<td>title</td>
<td>text</td>
<td></td>
<td><small><em>Not displayed if empty</em></small></td>
</tr>
<tr>
<td>content</td>
<td>string / html</td>
<td></td>
<td>Popup body content.<br />
HTML or Text string.<br />
<small><em>Not displayed if empty</em></small>
</td>
</tr>
<tr>
<td>width</td>
<td>number</td>
<td>600</td>
<td>Width of the popup.<br />
Accepts percent (%) or pixels (px)
</td>
</tr>
<tr>
<td>maxHeight</td>
<td>number</td>
<td></td>
<td>Give max height to the content container for longer content.<br />
A scrollbar will appear if content overflows.
</td>
</tr>
<tr>
<td>offsetTop</td>
<td>number</td>
<td>vertically centered</td>
<td>If the popup needs to appear some pixels away from the top instead of being vertically centered.
</td>
</tr>
<tr>
<td>responsive</td>
<td>boolean</td>
<td>false</td>
<td> <strong>true</strong> or <strong>false</strong>
<br />
Width of the popup will be maximum 100%;</td>
</tr>
<tr>
<td>closeButton</td>
<td>boolean</td>
<td>true</td>
<td>Display the <strong>"×"</strong> close button on top right.</td>
</tr>
<tr>
<td>closeBtnTooltip</td>
<td>text</td>
<td>"Close"</td>
<td>Tooltip for the default <strong>"×"</strong> clsoe button on top right.<br />
Give <strong>false</strong> if to hide.
</td>
</tr>
<tr>
<td>overlayColor</td>
<td>CSS Color</td>
<td>black</td>
<td>Change color of the overlay background.<br />
Accepts CSS color names or hex color codes.
</td>
</tr>
<tr>
<td>overlayOpacity</td>
<td>0.0 - 1.0</td>
<td>0.9</td>
<td>Transparency of overlay background. Accepts CSS '<em>opacity</em>' values.</td>
</tr>
<tr>
<td>focus</td>
<td>boolean</td>
<td>false</td>
<td>If want to focus on the first '<em>input</em>' or '<em>textarea</em>' when the popup is opened.</td>
</tr>
<tr>
<td>escClose</td>
<td>boolean</td>
<td>true</td>
<td>Allow popup to close by pressing "Escape" or "Esc" key.</td>
</tr>
<tr>
<td>closeClass</td>
<td>string</td>
<td>"pop-close"</td>
<td>If want any link <strong><a></strong> or <strong>button</strong> or any element inside your content to trigger <strong>popup close</strong>, give it this classname.</td>
</tr>
<tr>
<td>fadeSpeed</td>
<td>number</td>
<td>200</td>
<td>Speed of fade animation while closing popup. Accepts jquery speed value for fadeOut.</td>
</tr>
<tr>
<td>buttons</td>
<td>Array object</td>
<td></td>
<td>Syntax:<br />
<pre class="code">[{ label [,classname] [,clickEvent]}]</pre>
Example:<br />
<pre class="code">
[
{ label: 'Save changes',
classname: 'primary',
clickEvent: function(){alert('Saving changes');}
},
{ label: 'Close'}
]</pre>
</td>
</tr>
<tr>
<td>contentType</td>
<td><strong>"ajax"</strong> or <strong>"iframe"</strong> or <strong>#elementID</strong></td>
<td></td>
<td>
You can add dynamic content via AJAX, or embed a video or a webpage using iframe,<br />
or take the content from an existing element in the DOM using '#' (for element ID).
</td>
</tr>
<tr>
<td>loadUrl</td>
<td>string</td>
<td></td>
<td><small>Applied for contentType AJAX and Iframe.</small><br />
Source URL to load via AJAX or iframe.<br /><br />
<small><em>Note: Currently do not support cross-domain URL for AJAX</em></small>
</td>
</tr>
<tr>
<td>iframeHeight</td>
<td>number</td>
<td>300px</td>
<td>Set height for Iframe content.<br />
<small>Accepts percent (%) or pixels (px)</small><br />
<small><em>Dynamic height coming soon.</em></small>
</td>
</tr>
<tr>
<td>iframeWidth</td>
<td>number</td>
<td>100%</td>
<td>Set width for the Iframe content.<br />
<small>Accepts percent (%) or pixels (px)</small>
</td>
</tr>
</table>
</div>
<div class="features">
<h3>Coming soon</h3>
<ul>
<li>IFrame dynamic height - Auto content height</li>
<li>Forms - Built in form submitting from popup</li>
</ul>
</div>
<p class="well">
Check: <a href="demo.html">Demo</a>
<a href="https://github.com/scazzy/Popelt">Github</a><br />
Download: <a href="https://github.com/scazzy/Popelt/blob/master/minified/popelt-v1.0.min.js">Minified</a><small>(5kb)</small> <a href="https://github.com/scazzy/Popelt/blob/master/source/popelt-v1.0-source.js">Source</a>
</p>
<hr/>
</div>
</body>
</html>