forked from utveckla/jsModal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
213 lines (208 loc) · 6.5 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
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>jsModal - Modal generator in pure JavaScript.</title>
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet" type="text/css" />
<style>
html {
font-family: arial, sans-serif;
color: #444;
}
body {
background: #eee;
}
#header {
background: #fafafa;
border-bottom: 1px solid #f2f2f2;
overflow: hidden;
text-align: center;
}
#jsmodal-logo {
float: right;
margin: 10px;
}
#wrapper {
background: #fff;
-moz-border-radius: 11px;
-webkit-border-radius: 11px;
border-radius: 11px;
margin: 0 auto;
width: 800px;
}
#wrapper > div {
display: block;
margin: 10px;
}
#footer {
background: #f9f9f9;
border-top: 1px solid #f5f5f5;
text-align: center;
}
h1, h4 {
font-family: "open sans", arial, sans-serif;
}
a {
color: #36c;
}
pre {
border: 1px solid #777;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.light-grey {
background-color: #F0F0F0;
}
.grey {
background-color: #EEE;
}
</style>
<link href="css/jsmodal-light.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<img id="jsmodal-logo" alt="jsModal" height="87" src="images/jsmodal-logo.png" width="100" />
<h1>jsModal!</h1>
<p>A modal box engine written in pure JavaScript</p>
</div>
<div id="content">
<h4>What is jsModal?</h4>
<p>jsModal is a fast, small, and feature-sufficient JavaScript modal box
engine. It makes things like generating modals much simpler with an easy-to-use
call that works across a multitude of browsers. With a combination of limitations
and constraints, jsModal will change the way that a super-minute fraction
of people write JavaScript.</p>
<h4>Who's using jsModal</h4>
<p>Well, nobody as far as we know. Everyone seems to be using that jQeer-thingy
library. Which is all good, because jsModal works seemlessly with it, and
several other available libraries such as (Cow sound)-Tools and (Homer exclamation)-Joe.</p>
<ul>
<li><a href="http://jsmodal.com" target="_blank">
jsModal official website</a></li>
<li>Download:<a href="https://drive.google.com/folderview?id=0B76smB_YGoSJd1RaREFMZVJpcE0&usp=sharing" target="_blank">
jsModal v1.0d</a></li>
<li>Google Code Repository:
<a href="http://code.google.com/p/jsmodal/" target="_blank">http://code.google.com/p/jsmodal/</a></li>
<li>
<a href="http://code.google.com/p/jsmodal/wiki/Parameters" target="_blank">
Full list and specification of usage parameters</a></li>
</ul>
<h4>A Brief Look</h4>
<p><strong>Launching a modal (plus draggable support)</strong> </p>
<pre>
<script>
document.getElementById('modal-1').onclick = function() {
Modal.open({
content: '<strong>Default modal!</strong><br />Testing the modal.<br /><br />Loreum ipsum dolorem the quick brown fox jumped over the lazy dog.<br /><br />Yes its true.',
draggable: true,
openCallback: function () {
alert('This is an example of the use of openCallback');
}
});
}
</script>
</pre>
<input id="modal-1" type="button" value="Example 1" />
<p><strong>Using some of the other parameters</strong> </p>
<pre>
<script>
document.getElementById('modal-2').onclick = function() {
Modal.open({
ajaxContent: 'http://jsmodal.com/ajax-example.html',
width: '50%', // Can be set to px, em, %, or whatever else is out there.
height: '50%',
hideclose: true, // Hides the close-modal graphic
closeAfter: 10 // Define this number in seconds.
});
}
</script>
</pre>
<input id="modal-2" type="button" value="Example 2" />
<p><strong>The parameters</strong></p>
<table style="width: 100%">
<tr>
<td class="light-grey">content:</td>
<td class="grey">Define content here. e.g. content: 'Hello World!',</td>
</tr>
<tr>
<td class="light-grey">ajaxContent:</td>
<td>Define the URL to the content (cross-domain requests not supported
yet).</td>
</tr>
<tr>
<td class="light-grey">width:<br />
height:</td>
<td class="grey">The width and height of the modal. If both or either
of them is left blank, the default will be 'auto'. Make sure to
include the format, i.e. '100px' or '100em' or '100%' etc.</td>
</tr>
<tr>
<td class="light-grey">draggable:</td>
<td>Set this to true in order to make the Modal draggable. (touch
support yet to be implemented).</td>
</tr>
<tr>
<td class="light-grey">closeAfter:</td>
<td class="grey">Define the number in seconds. The modal will close
after the provided time.</td>
</tr>
<tr>
<td class="light-grey">hideClose:</td>
<td>Set this to true in order to hide the close graphic. The modal
will still be escapable via the ESC key or clicking the overlay.</td>
</tr>
<tr>
<td class="light-grey">lock:</td>
<td class="grey">Set this to true in order to make the modal unescapable
and hides the close graphic. You will have to set a close trigger
within the modal (or alternatively, closeAfter:). To set a close
trigger, call: Modal.close();</td>
</tr>
<tr>
<td class="light-grey">openCallback:</td>
<td class="grey">Allows you to pass a function to be run when the
modal has been opened.</td>
</tr>
<tr>
<td class="light-grey">closeCallback:</td>
<td>Allows you to pass a function to be run when upon closing of
the modal.</td>
</tr>
<tr>
<td class="light-grey">hideOverlay:</td>
<td class="grey">Disables the overlay if you set this to false.<br />
Note: If you dont intend on using this, you don't have to include
it at all when opening a modal.</td>
</tr>
</table>
</div>
<div id="footer">
© 2013 Henry Tang Kai</div>
</div>
<script src="js/jsmodal-1.0d.js"></script>
<script>
document.getElementById('modal-1').onclick = function() {
Modal.open({
content: '<strong>Default modal!</strong><br />Testing the modal.<br /><br />Loreum ipsum dolorem the quick brown fox jumped over the lazy dog.<br /><br />Yes its true.',
draggable: true,
openCallback: function () {
alert('This is an example of the use of openCallback');
}
});
}
document.getElementById('modal-2').onclick = function() {
Modal.open({
ajaxContent: 'ajax-example.html',
width: '50%',
height: '50%',
hideClose: true,
closeAfter: 10
});
}
</script>
</body>
</html>