forked from june07/nodebb-plugin-lightgallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
18 lines (18 loc) · 743 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require(['jquery'], function($) {
require(['lightgallery'], function(lightgallery) {
require(['lg-thumbnail', 'lg-autoplay', 'lg-video', 'lg-fullscreen', 'lg-pager', 'lg-zoom', 'lg-hash', 'lg-share'], function(lgthumbnail, lgautoplay, lgvideo, lgfullscreen, lgpager, lgzoom, lghash, lgshare) {
$(document).ready(function() {
initLightGallery();
});
$(window).on('action:topic.loaded', function(data) {
initLightGallery();
});
function initLightGallery() {
$("[id^=lightgallery]").lightGallery({
exThumbImage: 'data-exthumbimage',
selector: 'a > img'
});
}
});
});
});