-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
142 lines (114 loc) · 3.87 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
<!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>Topbox demo</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/topbox.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.easing.js"></script>
<script type="text/javascript" src="js/topbox.js"></script>
<script type="text/javascript">
jQuery(function($) {
$("#btnDemo").bind("click", function(){
$.topbox.show('test',{
title: 'Test caption',
buttons: {
Close: function(){
this.close();
}
}
});
});
$("#btnDemo2").bind("click", function(){
$.topbox.show('test',{
title: 'Test caption',
theme: "dark",
buttons: {
Close: function(){
this.close();
}
}
});
});
$("#btnDemo3").bind("click", function(){
$.topbox.show('test',{
title: 'Test caption',
theme: "classic",
buttons: {
Close: function(){
this.close();
}
}
});
});
$("#btnAlert").bind("click", function(){
$.topbox.alert('This is an alert!');
});
$("#btnConfirm").bind("click", function(){
$.topbox.confirm('Message to confirm', function(){
alert("Yep, confirmed!");
this.close();
});
});
$("#btnBlockUI").bind("click", function(){
$.topbox.blockUI('This screen is blocked for 5 seconds!', {title:"Blocking the screen..."});
setTimeout(function(){$.topbox.close();}, 5000);
});
});
</script>
</head>
<body>
<div class="wrapper">
<h1>Topbox <span>- a product by <a href="http://d-xp.com">d-xp.com</a></span></h1>
<p>
... a dialog alternative.
</p>
<p>
<button id="btnDemo">Click me</button>
<button id="btnDemo2">Dark theme</button>
<button id="btnDemo3">Classic theme</button>
</p>
<h2>Usage</h2>
<p>
<pre>
$.topbox.show(content, <span style="color:#999;">{
//settings
'title' : false,
'closeOnEsc': true,
'theme' : 'default',
'height' : 'auto',
'width' : 'auto',
'speed' : 500,
'easing' : 'swing',
'buttons' : false,
//events
'beforeShow' : function(){},
'beforeClose' : function(){},
'onClose' : function(){}
}</span>);
</pre>
where content could be a string, dom element or jQuery element.
</p>
<h2>Shortcuts</h2>
<p>
<button id="btnAlert">Alert</button>
<pre>
$.topbox.alert("...")
</pre>
<button id="btnConfirm">Confirm</button>
<pre>
$.topbox.confirm("...", function(){
//your callback code
});
</pre>
<button id="btnBlockUI">Block UI</button>
<pre>
$.topbox.blockUI("...")
</pre>
</p>
<h2>Code</h2>
<p><a href="https://github.com/aheinze/Topbox">Fork me on github</a></p>
</div>
</body>
</html>