innovationdrive-design/docs/js/main.js
2019-02-27 00:10:22 +11:00

71 lines
No EOL
2.1 KiB
JavaScript

(function($, window, document, undefined) {
'use strict';
// init cubeportfolio
$('#js-grid-lightbox-gallery').cubeportfolio({
filters: '#js-filters-lightbox-gallery1, #js-filters-lightbox-gallery2',
layoutMode: 'grid',
mediaQueries: [{
width: 1500,
cols: 4,
}, {
width: 1100,
cols: 3,
}, {
width: 800,
cols: 3,
}, {
width: 480,
cols: 2,
options: {
caption: '',
}
}],
defaultFilter: '*',
animationType: 'flipOutDelay',
gapHorizontal: 10,
gapVertical: 10,
gridAdjustment: 'responsive',
caption: 'overlayBottomAlong',
displayType: 'sequentially',
displayTypeSpeed: 100,
// lightbox
lightboxDelegate: '.cbp-lightbox',
lightboxGallery: true,
lightboxTitleSrc: 'data-title',
lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>',
// singlePageInline
singlePageInlineDelegate: '.cbp-singlePageInline',
singlePageInlinePosition: 'below',
singlePageInlineInFocus: true,
singlePageInlineCallback: function(url, element) {
// to update singlePageInline content use the following method: this.updateSinglePageInline(yourContent)
var t = this;
$.ajax({
url: url,
type: 'GET',
dataType: 'html',
timeout: 30000
})
.done(function(result) {
t.updateSinglePageInline(result);
})
.fail(function() {
t.updateSinglePageInline('AJAX Error! Please refresh the page!');
});
},
plugins: {
loadMore: {
element: '#js-loadMore-lightbox-gallery',
action: 'click',
loadItems: 3,
}
},
});
})(jQuery, window, document);