forked from germanysbestkeptsecret/Wookmark-jQuery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
34 lines (30 loc) · 957 Bytes
/
app.js
File metadata and controls
34 lines (30 loc) · 957 Bytes
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
requirejs.config({
"paths": {
"jquery": "../libs/jquery.min",
"imagesLoaded": "../libs/jquery.imagesloaded",
"wookmark": "../jquery.wookmark",
"colorbox": "../libs/jquery.colorbox-min"
},
"shim": {
"colorbox": ["jquery"]
}
});
requirejs(['jquery', 'imagesLoaded', 'wookmark', 'colorbox'], function($) {
$('#tiles').imagesLoaded(function() {
// Prepare layout options.
var options = {
autoResize: true, // This will auto-update the layout when the browser window is resized.
container: $('#main'), // Optional, used for some extra CSS styling
offset: 2, // Optional, the distance between grid items
itemWidth: 210 // Optional, the width of a grid item
};
// Get a reference to your grid items.
var handler = $('#tiles li');
// Call the layout function.
handler.wookmark(options);
// Init lightbox
$('a', handler).colorbox({
rel: 'lightbox'
});
});
});