Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
82 lines (61 loc) · 1.9 KB
/
Copy pathscript.js
File metadata and controls
82 lines (61 loc) · 1.9 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(function($) {
"use strict";
$(document).ready(function() {
// masonoary //
initIsotope();
// lightbox
lightbox.option({
'resizeDuration': 200,
'wrapAround': true,
'fitImagesInViewport': true
})
/* swiper */
var testimonialSwiper = new Swiper(".testimonial-swiper", {
spaceBetween: 20,
pagination: {
el: ".testimonial-swiper-pagination",
clickable: true,
},
breakpoints: {
0: {
slidesPerView: 1,
},
800: {
slidesPerView: 3,
},
1400: {
slidesPerView: 3,
}
},
});
}); // End of a document ready
// init Isotope
var initIsotope = function() {
$('.grid').each(function(){
// $('.grid').imagesLoaded( function() {
// images have loaded
var $buttonGroup = $( '.button-group' );
var $checked = $buttonGroup.find('.is-checked');
var filterValue = $checked.attr('data-filter');
var $grid = $('.grid').isotope({
itemSelector: '.portfolio-item',
// layoutMode: 'fitRows',
filter: filterValue
});
// bind filter button click
$('.button-group').on( 'click', 'a', function(e) {
e.preventDefault();
filterValue = $( this ).attr('data-filter');
$grid.isotope({ filter: filterValue });
});
// change is-checked class on buttons
$('.button-group').each( function( i, buttonGroup ) {
$buttonGroup.on( 'click', 'a', function() {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$( this ).addClass('is-checked');
});
});
// });
});
}
})(jQuery);