forked from vast-engineering/jquery-popup-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
968 lines (794 loc) · 28.8 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
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Popup Overlay</title>
<!-- Force latest IE, Google Chrome Frame for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="jQuery plugin for responsive and accessible modal windows and tooltips." />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Bootstrap styles -->
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css" />
<!-- Font Awesome icons -->
<link rel="stylesheet" href="http://weloveiconfonts.com/api/?family=fontawesome">
<style>
[class*="fontawesome-"]:before {
font-family: 'FontAwesome', sans-serif;
}
</style>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<!-- jQuery Popup Overlay -->
<script src="jquery.popupoverlay.js"></script>
<!-- Custom styles for the demo page -->
<style>
img {
max-width: 100%;
}
.well {
box-shadow: 0 0 10px rgba(0,0,0,0.3);
display:none;
margin:1em;
}
pre.prettyprint {
padding: 9px 14px;
}
.fulltable {
max-width: 100%;
overflow: auto;
}
.container {
padding-left: 0;
padding-right: 0;
}
.lineheight {
line-height: 3em;
}
.pagetop {
background: url(http://subtlepatterns.com/patterns/congruent_outline.png) #333;
background-attachment: fixed;
color: #fff;
}
.page-header {
border-bottom: none;
}
.initialism {
font-weight: bold;
letter-spacing: 1px;
font-size: 12px;
}
</style>
</head>
<body>
<div class="pagetop">
<div class="container">
<div class="page-header col-md-10 col-md-offset-1">
<h1>jQuery Popup Overlay</h1>
<p>jQuery plugin for responsive and accessible modal windows and tooltips</p>
<p class="h1">
<a href="https://github.com/vast-engineering/jquery-popup-overlay/archive/gh-pages.zip" class="btn btn-primary btn-success btn-lg"><span class="fontawesome-download-alt"></span> Download</a>
<a href="https://github.com/vast-engineering/jquery-popup-overlay" class="btn btn-lg btn-default"><span class="fontawesome-github"></span> View project on GitHub</a>
</p>
<p class="text-muted">Currently v1.7.4</p>
</div>
</div>
</div>
<div class="container">
<section class="col-md-10 col-md-offset-1">
<h2>Demo</h2>
<p class="lineheight">
<a class="initialism basic_open btn btn-success" href="#basic">Basic</a>
<a class="initialism fade_open btn btn-success" href="#fade">Fade</a>
<a class="initialism fadeandscale_open btn btn-success" href="#fadeandscale">Fade & scale</a>
<button class="initialism slide_open btn btn-success">Slide</button>
<button class="initialism standalone_open btn btn-success">Stand alone</button>
<a class="initialism active_bg_open btn btn-success" href="#active_bg">Active background</a>
<a href="#my_tooltip" class="initialism my_tooltip_open btn btn-success" id="my_tooltip_open">Tooltip</a>
<button class="initialism fall_open btn btn-success">Callback events</button>
<button class="initialism other_open btn btn-success">…</button>
</p>
<h2>Features</h2>
<ul>
<li><b>Positioned with CSS:</b>
Overlays are horizontally and vertically centered with CSS, without any JavaScript offset calculations,
therefore remain centered even if their height change.</li>
<li><b>Suitable for responsive web design: </b>
Overlays are fully customizable with CSS and will adapt to any screen size and orientation.
You can set a flexible minimum and maximum width and height to the overlay, as well as media queries.</li>
<li><b>Always visible: </b>
If the height of the overlay exceeds the visible area, vertical scrolling
will be automatically enabled to prevent the off-screen content from being unreachable.</li>
<li><b>Accessible: </b>
Keyboard navigable using <kbd>Tab</kbd> key. <abbr title="Web Accessibility Initiative - Accessible Rich Internet Applications">WAI-ARIA</abbr> roles are added automatically if missing. Text resizing or zooming will not break the layout, visibility, or position of the popup.</li>
<li><b>Device independent: </b>
Works well on desktops, tablets, most modern phones and other devices. Optimized and tested in all modern browsers including <abbr title="Internet Explorer 7 and later">IE7+</abbr>, and in new versions of popular screen readers including JAWS, NVDA, and VoiceOver.</li>
<li><b>Flexible and customizable: </b>
Supports multiple popup instances, custom CSS3 animations and transitions...</li>
</ul>
<h2>Usage</h2>
<pre class="prettyprint">
<code><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Site Title</title>
</head>
<body>
<!-- Add an optional button to open the popup -->
<button class="my_popup_open">Open popup</button>
<!-- Add content to the popup -->
<div id="my_popup">
...popup content...
<!-- Add an optional button to close the popup -->
<button class="my_popup_close">Close</button>
</div>
<!-- Include jQuery -->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<!-- Include jQuery Popup Overlay -->
<script src="http://vast-engineering.github.io/jquery-popup-overlay/jquery.popupoverlay.js"></script>
<script>
$(document).ready(function() {
// Initialize the plugin
$('#my_popup').popup();
});
</script>
</body>
</html></code>
</pre>
<h3>Options</h3>
<div class="fulltable">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>'overlay'<br />'tooltip'</td>
<td>'overlay'</td>
<td>Sets popup type to overlay or tooltip.</td>
</tr>
<tr>
<td>autoopen</td>
<td>boolean</td>
<td>false</td>
<td>Shows the popup when initialized.</td>
</tr>
<tr>
<td>scrolllock</td>
<td>boolean</td>
<td>false</td>
<td>Disables scrolling of background content while the popup is visible.</td>
</tr>
<tr>
<td>background</td>
<td>boolean</td>
<td>true</td>
<td>Enables background cover.<br />
<small class="text-muted">Disabled for tooltips.</small></td>
</tr>
<tr>
<td>backgroundactive</td>
<td>boolean</td>
<td>false</td>
<td>Disable background cover and keep background elements active.<br />
<small class="text-muted">Implies background, blur and scrolllock to false</small></td>
</tr>
<tr>
<td>color</td>
<td>string <small class="text-muted"><i>(CSS color)</i></small></td>
<td>'#000'</td>
<td>Sets background color.</td>
</tr>
<tr>
<td>opacity</td>
<td>float</td>
<td>0.5</td>
<td>Sets background opacity.</td>
</tr>
<tr>
<td>horizontal</td>
<td>'center'<br />'left'<br />'right'<br /><span class="text-muted">'leftedge'</span><br /><span class="text-muted">'rightedge'</span></td>
<td>'center'</td>
<td><p>Sets horizontal position.</p>
<p class="text-muted"><small>Options `leftedge` and `rightedge` can be used only for tooltips, and will align the tooltip to the left or right edge of the opening element (`openelement`).</small></p></td>
</tr>
<tr>
<td>vertical</td>
<td>'center'<br />'top'<br />'bottom'<br /><span class="text-muted">'topedge'</span><br /><span class="text-muted">'bottomedge'</span></td>
<td>'center'</td>
<td><p>Sets vertical position.</p>
<p class="text-muted"><small>Options `topedge` and `bottomedge` can be used only for tooltips, and will align the tooltip to the top or bottom edge of the opening element (`openelement`).</small></p></td>
</tr>
<tr>
<td>offsettop</td>
<td>number</td>
<td>0</td>
<td><p>Sets top offset to tooltip.</p></td>
</tr>
<tr>
<td>offsetleft</td>
<td>number</td>
<td>0</td>
<td><p>Sets left offset to tooltip.</p></td>
</tr>
<tr>
<td>escape</td>
<td>boolean</td>
<td>true</td>
<td>Closes the popup when <kbd>Escape</kbd> key is pressed.</td>
</tr>
<tr>
<td>blur</td>
<td>boolean</td>
<td>true</td>
<td>Closes the popup when clicked outside of it.</td>
</tr>
<tr>
<td>setzindex</td>
<td>boolean</td>
<td>true</td>
<td>Sets default z-index to the popup (2001) and to the background (2000).</td>
</tr>
<tr>
<td>autozindex</td>
<td>boolean</td>
<td>false</td>
<td><p>Sets highest z-index on the page to the popup.</p></td>
</tr>
<tr>
<td>keepfocus</td>
<td>boolean</td>
<td>true</td>
<td>Lock keyboard focus inside of popup. Recommended to be enabled.</td>
</tr>
<tr>
<td>focuselement</td>
<td>string <small class="text-muted"><i>(CSS selector)</i></small></td>
<td>'#<i>{popup_id}</i>'</td>
<td>Enables you to specify the element which will be focused upon showing the popup. By default, the popup element <code>#my_popup</code> will recieve the initial focus.</td>
</tr>
<tr>
<td>focusdelay</td>
<td>number</td>
<td>50</td>
<td>Sets a delay in milliseconds before focusing an element. This is to prevent page scrolling during opening transition, as browsers will try to move the viewport to an element which received the focus.</td>
</tr>
<tr>
<td>pagecontainer</td>
<td>string <small class="text-muted"><i>(CSS selector)</i></small></td>
<td></td>
<td><p>Sets a page container (to help screen reader users). Page container should be the element that surrounds all the content on the page (e.g. '.container' in the case of this very page).</p>
<p class="text-muted"><small>It's highly recommended that you set the page container to help some screen readers read the modal dialog correctly. Doing so, when the popup is visible, <code>aria-hidden="true"</code> will be set to the page container and <code>aria-hidden="false"</code> to the popup, and vice-versa when the popup closes. You can set `pagecontainer` once per website (e.g. <code>$.fn.popup.defaults.pagecontainer = '.container'</code>).</small></p></td>
</tr>
<tr>
<td>outline</td>
<td>boolean</td>
<td>false</td>
<td><p>Shows a default browser outline on popup element when focused.</p>
<p class="text-muted"><small>Setting to <code>false</code> is equivalent to <code>#my_popup{outline: none;}</code>.</small></p></td>
</tr>
<tr>
<td>detach</td>
<td>boolean</td>
<td>false</td>
<td>
<p>Removes popup element from the DOM after closing transition.</p>
</td>
</tr>
<tr>
<td>openelement</td>
<td>string <small class="text-muted"><i>(CSS selector)</i></small></td>
<td>'.<i>{popup_id}</i>_open'</td>
<td>Enables you to define custom element which will open the popup on click. By default, in our case it's set to <code>.my_popup_open</code>.</td>
</tr>
<tr>
<td>closeelement</td>
<td>string <small class="text-muted"><i>(CSS selector)</i></small></td>
<td>'.<i>{popup_id}</i>_close'</td>
<td>Enables you to define custom element which will close the popup on click. By default, in our case it's set to <code>.my_popup_close</code>.</td>
</tr>
<tr>
<td>transition</td>
<td>string <small class="text-muted"><i>(CSS transition)</i></small></td>
<td></td>
<td>
<p>Sets CSS transition when showing and hiding a popup.</p>
<p class="text-muted"><small>Use this if you don't need separate transition for background, or different transition for opening and closing the popup, or if you need to transition only selected properties – otherwise set custom transitions directly in CSS.</small></p>
<p class="text-muted"><small>Simple fade effect <code>$('#my_popup').popup({transition: 'all 0.3s'})</code> is equivalent to <code>#my_popup, #my_popup_wrapper, #my_popup_background {transition: all 0.3s;}</code></small></p>
<p class="text-muted"><small>Setting fade effect for all popups on the site: <code>$.fn.popup.defaults.transition = 'all 0.3s';</code> is equivalent to <code>.popup_content, .popup_wrapper, .popup_background {transition: all 0.3s;}</code></small></p>
</td>
</tr>
<tr>
<td>tooltipanchor</td>
<td>object <br /><small class="text-muted"><i>JQuery or DOM object</i></small></td>
<td></td>
<td>
<p>Sets an element to be an anchor for tooltip position.</p>
<p class="text-muted"><small>For example, for multiple opening links using the same tooltip on mouseover:</small></p>
<pre class="prettyprint">
<code>$('.my_popup_open').on({
mouseenter: function(event) {
$('#my_popup').popup({
tooltipanchor: event.target,
autoopen: true,
type: 'tooltip'
});
},
mouseleave: function() {
$('#my_popup').popup('hide');
}
});</code>
</pre>
</td>
</tr>
<tr>
<td colspan="4">
<p>Example:</p>
<pre class="prettyprint">
<code>$('#my_popup').popup({
opacity: 0.3,
transition: 'all 0.3s'
});</code>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
<h3>Callback events</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>beforeopen</td>
<td>function</td>
<td>Callback function which will execute before the popup is opened.</td>
</tr>
<tr>
<td>onopen</td>
<td>function</td>
<td>Callback function which will execute when the popup starts to open.</td>
</tr>
<tr>
<td>onclose</td>
<td>function</td>
<td>Callback function which will execute when the popup starts to close.</td>
</tr>
<tr>
<td>opentransitionend</td>
<td>function</td>
<td>Callback function which will execute after the opening CSS transition is over, only if transition actually occurs and if supported by the browser.</td>
</tr>
<tr>
<td>closetransitionend</td>
<td>function</td>
<td>Callback function which will execute after the closing CSS transition is over, only if transition actually occurs and if supported by the browser.</td>
</tr>
<tr>
<td colspan="3">
<p>Example:</p>
<pre class="prettyprint">
<code>$('#my_popup').popup({
onopen: function() {
alert('Popup just opened!');
}
});</code>
</pre>
</td>
</tr>
</tbody>
</table>
<h3>Defaults</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td><p>Default values for options and events can be modified.</p></td>
</tr>
</thead>
<tr>
<td>
<p>Example:</p>
<pre class="prettyprint">
<code>$.fn.popup.defaults.transition = 'all 0.3s';
$.fn.popup.defaults.pagecontainer = '.container';
</code></pre>
</td>
</tr>
</table>
<h3>Methods</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>.popup(options)</td>
<td><p>Activates your content as a popup. Accepts an optional options <code>object</code>.</p>
<pre class="prettyprint">
<code>$('#my_popup').popup({
background: false
});
</code>
</pre>
</td>
</tr>
<tr>
<td>.popup('show')</td>
<td>
<p>Manually opens a popup.</p>
<pre class="prettyprint"><code>$('#my_popup').popup('show');</code></pre>
</td>
</tr>
<tr>
<td>.popup('hide')</td>
<td>
<p>Manually hides a popup.</p>
<pre class="prettyprint"><code>$('#my_popup').popup('hide');</code></pre>
</td>
</tr>
<tr>
<td>.popup('toggle')</td>
<td>
<p>Manually toggles a popup.</p>
<pre class="prettyprint"><code>$('#my_popup').popup('toggle');</code></pre>
</td>
</tr>
</tbody>
</table>
<p> </p>
</section>
<footer class="col-md-10 col-md-offset-1" role="contentinfo">
<iframe src="http://ghbtns.com/github-btn.html?user=vast-engineering&repo=jquery-popup-overlay&type=watch&size=small&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
<p class="text-muted"><small>Released under the <a href="http://opensource.org/licenses/MIT">MIT</a> license.</small></p>
</footer>
</div>
<!-- Set defaults -->
<script>
$(document).ready(function () {
$.fn.popup.defaults.pagecontainer = '.container'
});
</script>
<!-- Basic -->
<div id="basic" class="well" style="max-width:44em;">
<h4>Basic example</h4>
<p>Try to change the width and height of browser window, or to rotate your device, and also try to navigate with the <kbd>Tab</kbd> key.</p>
<p>You can close the dialog by pressing the <kbd>Esc</kbd> key, or by clicking on the background outside the content area, or by clicking on the Close button.</p>
<button class="basic_close fade_open btn btn-default">Next example</button>
<button class="basic_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#basic').popup();
});
</script>
<!-- Fade -->
<div id="fade" class="well">
<h4>Fade example</h4>
<pre class="prettyprint">
<code>$('#fade').popup({
transition: 'all 0.3s',
scrolllock: true // optional
});</code>
</pre>
<p>Or you can set transitions directly in CSS:</p>
<pre class="prettyprint"><code>$('#fade').popup();</code></pre>
<pre class="prettyprint"><code>#fade,
#fade_wrapper,
#fade_background {
transition: all 0.3s;
}
</code>
</pre>
<button class="fade_close fadeandscale_open btn btn-default">Next example</button>
<button class="fade_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#fade').popup({
transition: 'all 0.3s',
scrolllock: true
});
});
</script>
<!-- Fade & scale -->
<div id="fadeandscale" class="well">
<h4>Fade & scale example</h4>
<pre class="prettyprint">
<code>$('#fadeandscale').popup({
transition: 'all 0.3s'
});</code>
</pre>
<pre class="prettyprint">
<code>#fadeandscale {
transform: scale(0.8);
}
.popup_visible #fadeandscale {
transform: scale(1);
}</code>
</pre>
<button class="fadeandscale_close slide_open btn btn-default">Next example</button>
<button class="fadeandscale_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#fadeandscale').popup({
pagecontainer: '.container',
transition: 'all 0.3s'
});
});
</script>
<style>
#fadeandscale {
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
.popup_visible #fadeandscale {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
</style>
<!-- Slide in -->
<div id="slide" class="well">
<h4>Slide in example</h4>
<pre class="prettyprint">
<code>$('#slide').popup({
outline: true, // optional
focusdelay: 400, // optional
vertical: 'top' //optional
});
</code>
</pre>
<pre class="prettyprint">
<code>#slide_background {
transition: all 0.3s 0.3s;
}
#slide,
#slide_wrapper {
transition: all 0.3s ease-out;
}
#slide {
transform: translateX(0) translateY(-40%);
}
.popup_visible #slide {
transform: translateX(0) translateY(0);
}
</code>
</pre>
<button class="slide_close standalone_open btn btn-default">Next example</button>
<button class="slide_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#slide').popup({
focusdelay: 400,
outline: true,
vertical: 'top'
});
});
</script>
<style>
#slide_background {
-webkit-transition: all 0.3s 0.3s;
-moz-transition: all 0.3s 0.3s;
transition: all 0.3s 0.3s;
}
#slide,
#slide_wrapper {
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
#slide {
-webkit-transform: translateX(0) translateY(-40%);
-moz-transform: translateX(0) translateY(-40%);
-ms-transform: translateX(0) translateY(-40%);
transform: translateX(0) translateY(-40%);
}
.popup_visible #slide {
-webkit-transform: translateX(0) translateY(0);
-moz-transform: translateX(0) translateY(0);
-ms-transform: translateX(0) translateY(0);
transform: translateX(0) translateY(0);
}
</style>
<!-- Stand alone -->
<div id="standalone">
<h4>Stand alone example</h4>
<pre class="prettyprint">
<code>$('#standalone').popup({
color: 'white',
opacity: 1,
transition: '0.3s',
scrolllock: true
});
</code>
</pre>
<pre class="prettyprint">
<code>#standalone {
transform: scale(0.8);
}
.popup_visible #standalone {
transform: scale(1);
}
</code>
</pre>
<button class="standalone_close active_bg_open btn btn-default">Next example</button>
<button class="standalone_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#standalone').popup({
color: 'white',
opacity: 1,
transition: '0.3s',
scrolllock: true
});
});
</script>
<style>
#standalone {
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
.popup_visible #standalone {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
</style>
<!-- Active background -->
<div id="active_bg" class="well" style="max-width:44em;">
<h4>Active background example</h4>
<p>You can click on any element at the background : they still active and won't close the popup.</p>
<p>You can close the dialog by pressing the <kbd>Esc</kbd> key, or by clicking on the Close button.</p>
<button class="active_bg_close my_tooltip_open btn btn-default">Next example</button>
<button class="active_bg_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#active_bg').popup({
backgroundactive:true
});
});
</script>
<!-- Tooltip -->
<div id="my_tooltip" class="well">
<a href="#" class="my_tooltip_close" style="float:right;padding:0 0.4em;">×</a>
<h4>Tooltip example</h4>
<p>Tooltip content will be positioned relative to the opening link.</p>
<button class="my_tooltip_close fall_open btn btn-default">Next example</button>
<button class="my_tooltip_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#my_tooltip').popup({
type: 'tooltip',
vertical: 'top',
transition: '0.3s all 0.1s',
tooltipanchor: $('#my_tooltip_open')
});
});
</script>
<!-- Callback events -->
<div id="fall" class="well" style="max-width: 45em;">
<h4>Callback events</h4>
<pre class="prettyprint">
<code>$('#fall').popup({
beforeopen: function () {
alert('beforeopen');
},
onopen: function () {
alert('onopen');
},
onclose: function () {
alert('onclose');
},
opentransitionend: function () {
alert('opentransitionend');
},
closetransitionend: function () {
alert('closetransitionend');
}
});
</code>
</pre>
<button class="fall_close other_open btn btn-default">Next example</button>
<button class="fall_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#fall').popup({
beforeopen: function () {
alert('beforeopen');
},
onopen: function () {
alert('onopen');
},
onclose: function () {
alert('onclose');
},
opentransitionend: function () {
alert('opentransitionend');
},
closetransitionend: function () {
alert('closetransitionend');
}
});
});
</script>
<style>
#fall_background {
-webkit-transition: all 3s;
-moz-transition: all 3s;
transition: all 3s;
}
#fall_wrapper {
-webkit-transition: all 3s;
-moz-transition: all 3s;
transition: all 3s;
-webkit-perspective: 1300px;
-moz-perspective: 1300px;
perspective: 1300px;
}
#fall {
-webkit-transition: all 3s ease-in;
-moz-transition: all 3s ease-in;
transition: all 3s ease-in;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translateZ(600px) rotateX(20deg);
-moz-transform: translateZ(600px) rotateX(20deg);
-ms-transform: translateZ(600px) rotateX(20deg);
transform: translateZ(600px) rotateX(20deg);
}
.popup_visible #fall {
-webkit-transform: translateZ(0px) rotateX(0deg);
-moz-transform: translateZ(0px) rotateX(0deg);
-ms-transform: translateZ(0px) rotateX(0deg);
transform: translateZ(0px) rotateX(0deg);
}
</style>
<!-- Other examples -->
<div id="other" class="well" style="max-width:44em; min-width: 30em;">
<h4>Other examples:</h4>
<ul>
<li><a target="_blank" href="http://jsbin.com/makajini/1/edit">Viewport Image</a></li>
</ul>
<button class="other_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function () {
$('#other').popup();
});
</script>
<!-- Google Prettify syntax highlighting -->
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?autoload=true&lang=css"></script>
<style>
pre.prettyprint {padding: 9px 14px;}
</style>
</body>
</html>