-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
112 lines (99 loc) · 3.07 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="QBox.css"></link>
<style>
/* Demo styles */
html {
font: 100% sans-serif;
}
.qb-content {
max-width: 30em;
padding: 0.5em;
background: chartreuse;
box-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.25);
}
.blue-background {
background-color: #acf;
border: 2px solid #00f;
}
.qb-loading {
margin-top: 100px;
background: grey;
}
</style>
<script src="QBox.js"></script>
<script>
window.onload = function(){
document.getElementById("default-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({ html : "<h1>Standard Popup</h1>" });
qBox.show();
}
document.getElementById("modal-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({ html : "<h1>Modal Popup</h1>", modal : true });
qBox.show();
}
document.getElementById("no-close-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({ html : "<h1>No Close Button Popup</h1>", showClose : false });
qBox.show();
}
document.getElementById("callback-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({
html : "<h1>Callbacks</h1><p>I also have a unique classname, and special close button html</p>",
onOpen : function(elem){ alert('on open'); console.log(elem); },
onClose : function(){ alert('on close'); },
closeHTML : "<b>Close</b>",
className : "blue-background"
});
qBox.show();
}
document.getElementById("no-auto-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({
html : "<h1>Not Auto Centered</h1>",
autoCenter : false
});
qBox.show();
}
document.getElementById("blur-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({
html : "<h1>Standard Popup</h1><p>...with the background blurred.</p>",
blurBackground: true
});
qBox.show();
}
document.getElementById("multi-pop").onclick = function(e){
e.preventDefault();
var qBox = new QBox({
html : "<h1>Standard Popup</h1><p>...with the background blurred.</p>",
blurBackground: true,
modal: true
});
var qBoxLoading = new QBox({
html : "Loading...",
className: "qb-loading"
});
qBoxLoading.show();
qBox.show();
}
}
</script>
</head>
<body>
<h1>qBox</h1>
<ul>
<li><a href="#" id="default-pop">Popup with no config, just default values</a></li>
<li><a href="#" id="modal-pop">Pop with modal true (cant click mask to close)</a></li>
<li><a href="#" id="no-close-pop">Popup with no close button</a></li>
<li><a href="#" id="callback-pop">Popup with callbacks and custom close html</a></li>
<li><a href="#" id="no-auto-pop">Popup not auto centered and custom close button ID</a></li>
<li><a href="#" id="blur-pop">Popup with background blurred</a></li>
<li><a href="#" id="multi-pop">Multiple Popups</a></li>
</ul>
</body>
</html>