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
39 lines (35 loc) · 1.07 KB
/
app.js
File metadata and controls
39 lines (35 loc) · 1.07 KB
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
requirejs.config({
"paths": {
"jquery": "../libs/jquery.min",
"imagesLoaded": "../libs/jquery.imagesloaded",
"wookmark": "../jquery.wookmark",
"magnificPopup": "../libs/jquery.magnific-popup.min"
},
"shim": {
"magnificPopup": ["jquery"],
"imagesLoaded": ["jquery"]
}
});
requirejs(['jquery', 'imagesLoaded', 'wookmark', 'magnificPopup'], 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
$('#tiles').magnificPopup({
delegate: 'li:not(.inactive) a',
type: 'image',
gallery: {
enabled: true
}
});
});
});