innovationdrive-design/templates/masonry-projects/js/main.js

72 lines
No EOL
2.1 KiB
JavaScript

(function($, window, document, undefined) {
'use strict';
// init cubeportfolio
$('#js-grid-masonry-projects').cubeportfolio({
filters: '#js-filters-masonry-projects',
layoutMode: 'grid',
defaultFilter: '*',
animationType: 'quicksand',
gapHorizontal: 35,
gapVertical: 25,
gridAdjustment: 'responsive',
mediaQueries: [{
width: 1500,
cols: 5,
}, {
width: 1100,
cols: 4,
}, {
width: 800,
cols: 3
}, {
width: 480,
cols: 2,
options: {
caption: '',
gapHorizontal: 25,
gapVertical: 10,
}
}],
caption: 'zoom',
displayType: 'fadeIn',
displayTypeSpeed: 100,
// lightbox
lightboxDelegate: '.cbp-lightbox',
lightboxGallery: true,
lightboxTitleSrc: 'data-title',
lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>',
// singlePage popup
singlePageDelegate: '.cbp-singlePage',
singlePageDeeplinking: true,
singlePageStickyNavigation: true,
singlePageCounter: '<div class="cbp-popup-singlePage-counter">{{current}} of {{total}}</div>',
singlePageCallback: function(url, element) {
// to update singlePage content use the following method: this.updateSinglePage(yourContent)
var t = this;
$.ajax({
url: url,
type: 'GET',
dataType: 'html',
timeout: 30000
})
.done(function(result) {
t.updateSinglePage(result);
})
.fail(function() {
t.updateSinglePage('AJAX Error! Please refresh the page!');
});
},
plugins: {
loadMore: {
element: '#js-loadMore-masonry-projects',
action: 'click',
loadItems: 3,
}
},
});
})(jQuery, window, document);