-
Notifications
You must be signed in to change notification settings - Fork 54
/
examples.html
executable file
·300 lines (269 loc) · 8.86 KB
/
examples.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
<!doctype html>
<html>
<head>
<title>jLayout Examples</title>
<meta charset="utf-8">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="../lib/jquery.sizes.js"></script>
<script type="text/javascript" src="../lib/jlayout.grid.js"></script>
<script type="text/javascript" src="../lib/jlayout.flexgrid.js"></script>
<script type="text/javascript" src="../lib/jlayout.flow.js"></script>
<script type="text/javascript" src="../lib/jlayout.border.js"></script>
<script type="text/javascript" src="../lib/jquery.jlayout.js"></script>
<script type="text/javascript">
jQuery(function($)
{
$('.grid').layout();
$('.flex-grid').layout();
$('.column').layout();
$('.border').layout();
$('.mpb').layout();
// we call the inner layout first
$('.nested-center').layout();
// then we set the outer one to a fixed size, and turn resizing off
$('.nested').width(600).height(400).layout({resize: false});
// we can also specify everything in code; in this example
// we create two columns of equal size.
$('.code').layout({
type: 'grid',
items: [
$('.col-1').width(400),
$('.col-2').width(400)
],
vgap: 3,
hgap: 3
});
$('#flow-left').layout();
$('.horizontal').layout();
$('.vertical').layout();
});
</script>
<style>
.grid, .flex-grid, .column, .border, .mpb, .nested-center, .nested, .code, .horizontal, .vertical {
overflow: auto;
}
.c {
background-color: rgb(220,220,220);
border: 1px solid rgb(200,200,200);
text-align: center;
width: 100px;
height: 100px;
display: inline-block;
}
.e {
height: 150px;
}
.d {
width: 150px;
}
.nested-center, .mpb {
display: inline-block;
}
.mpb .center {
margin-left: 5em;
width: 5em;
height: 5em;
}
.mpb .east {
border-right: 2em solid green;
width: 10em;
}
.mpb .north {
padding-top: 2em;
height: 2em;
width: 35em;
}
.col-1, .col-2 {
padding-right: 2em;
text-align: justify;
display: inline-block;
}
#flow-left {
overflow: auto;
width: 350px;
height: 200px;
}
#flow-left div {
width: auto;
height: auto;
}
.large {
font-size: 3.5em;
}
.small {
font-size: 2em;
}
.medium {
font-size: 3em;
}
</style>
</head>
<body>
<h1><a href="http://www.bramstein.com/projects/jlayout/">jLayout project homepage</a></h1>
<a name="simple-grid"></a>
<h1>2x2 grid</h1>
<div data-layout='{"type": "grid", "hgap": 3, "vgap": 3, "columns": 2, "rows": 2}' class="grid">
<div class="c">
One
</div>
<div class="c">
Two
</div>
<div class="c">
Three
</div>
<div class="c">
Four
</div>
</div>
<h1>3x2 flex-grid</h1>
<div data-layout='{"type": "flexGrid", "hgap": 3, "vgap": 3, "columns": 3, "rows": 2}' class="flex-grid">
<div class="c">
One
</div>
<div class="c d">
Two
</div>
<div class="c">
Three
</div>
<div class="c">
Four
</div>
<div class="c d">
Five
</div>
<div class="c">
Six
</div>
</div>
<a name="columns"></a>
<h1>Automatic columns</h1>
<div data-layout='{"type": "grid", "hgap": 3, "vgap": 3}' class="column">
<div class="c">
One
</div>
<div class="c">
Two
</div>
</div>
<a name="border"></a>
<h1>Border</h1>
<div data-layout='{"type": "border", "hgap": 3, "vgap": 3}' class="border">
<div class="c center">
Center
</div>
<div class="c east">
East
</div>
<div class="c west">
West
</div>
<div class="c north">
North
</div>
<div class="c south">
South
</div>
</div>
<a name="mpb"></a>
<h1>Margin, Padding & Border</h1>
<div data-layout='{"type": "border", "hgap": 3, "vgap": 3}' class="mpb">
<div class="c center">
Center + Margin-Left
</div>
<div class="c north">
North + Padding-Top
</div>
<div class="c east">
East + Border-Right
</div>
</div>
<a name="nested"></a>
<h1>Nested layouts</h1>
<div data-layout='{"type": "border", "hgap": 3, "vgap": 3}' class="nested">
<div data-layout='{"type": "grid", "hgap": 3, "vgap": 3, "columns": 2, "rows": 2}' class="center nested-center">
<div class="c">
One
</div>
<div class="c">
Two
</div>
<div class="c">
Three
</div>
<div class="c">
Four
</div>
</div>
<div class="c east">
East
</div>
<div class="c west">
West
</div>
<div class="c north">
North
</div>
<div class="c south">
South
</div>
</div>
<a name="code"></a><h1>Programmatic grid (columns)</h1>
<div class="code">
<div class="col-1">
<h2>Column 1</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque neque erat, fringilla id, pretium imperdiet, sagittis et, urna. In hac habitasse platea dictumst. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam consequat ullamcorper nulla. Nunc felis lacus, mollis in, mattis a, aliquam at, mi. Quisque laoreet vehicula felis. Nullam purus nulla, accumsan ut, tincidunt vitae, dapibus ac, ante. Proin at pede eget sem ullamcorper porta. Sed quis mauris. Vivamus interdum. Ut eu dolor vel nisi auctor tincidunt. Fusce adipiscing mollis augue. Cras a nunc a elit dictum tincidunt. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam molestie, leo nec faucibus egestas, est sapien varius velit, vitae posuere enim mi et arcu. Sed facilisis est at urna.</p>
<p>Mauris at dolor. Nulla ultricies congue enim. Ut laoreet, ipsum id rutrum mattis, odio sem iaculis neque, eu gravida diam nulla ut nibh. Etiam cursus elementum libero. Suspendisse quis tellus id sapien elementum elementum. Mauris luctus orci eu lorem. Vivamus eu metus. Donec rhoncus porttitor massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean id tellus sed mauris lacinia hendrerit. Quisque ultrices. Donec a dui eget orci malesuada imperdiet.</p>
</div>
<div class="col-2">
<h2>Column 2</h2>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla eget dui. Sed at sem. Vestibulum pharetra suscipit sapien. Aliquam tortor lacus, consequat a, consectetuer quis, adipiscing sit amet, quam. Pellentesque id elit ut dolor iaculis tincidunt. Mauris pharetra, quam vitae pharetra viverra, metus nisi convallis diam, cursus rhoncus eros felis a enim. Duis aliquam molestie urna. In commodo cursus risus. Praesent sem nisi, commodo quis, egestas vel, auctor congue, magna. Nulla facilisi. Quisque facilisis, mauris sit amet semper sollicitudin, pede elit ultricies nunc, ac condimentum odio sapien id sem. In hac habitasse platea dictumst. Praesent rhoncus, neque eu dictum tristique, felis est aliquam est, in lobortis arcu justo non diam. Integer ligula pede, adipiscing at, mattis sit amet, aliquam vel, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
<p>Duis urna. Donec porta, nisl vel egestas euismod, lorem ipsum suscipit ligula, nec venenatis leo lorem non dolor. Sed fringilla mauris at elit. Suspendisse potenti. Proin magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur vel arcu. Donec dapibus mi vitae metus. Ut vestibulum nunc id nisi. Nunc convallis, tellus at fringilla pulvinar, lacus dui gravida risus, id sollicitudin nibh urna sit amet purus.</p>
</div>
</div>
<h1>Flow layout (left)</h1>
<div id="flow-left" data-layout='{"type": "flow", "resize": false, "alignment": "left"}'>
<div class="c small">
One
</div>
<div class="c medium">
Two
</div>
<div class="c medium">
Three
</div>
<div class="c large">
Four
</div>
<div class="c small">
Five
</div>
</div>
<h1>Horizontal layout</h1>
<div data-layout='{"type": "flexGrid", "rows": 1, "hgap": 5, "vgap": 5}' class="horizontal">
<div class="c">
One
</div>
<div class="c d">
Two
</div>
<div class="c">
Three
</div>
</div>
<h1>Vertical layout</h1>
<div data-layout='{"type": "flexGrid", "columns": 1, "hgap": 5, "vgap": 5}' class="vertical">
<div class="c">
One
</div>
<div class="c e">
Two
</div>
<div class="c">
Three
</div>
</div>
<a href="http://www.bramstein.com/projects/jlayout/">Back to the jLayout project homepage</a>
</body>
</html>