-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.js
113 lines (86 loc) · 2.71 KB
/
custom.js
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// google map
var map = '';
var center;
function initialize() {
var mapOptions = {
zoom: 16,
center: new google.maps.LatLng(40.7679619,-73.9800172),
scrollwheel: false
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
google.maps.event.addDomListener(map, 'idle', function() {
calculateCenter();
});
google.maps.event.addDomListener(window, 'resize', function() {
map.setCenter(center);
});
}
function calculateCenter() {
center = map.getCenter();
}
function loadGoogleMap(){
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' + 'callback=initialize';
document.body.appendChild(script);
}
// Flexslider
$(function(){
/* FlexSlider */
$('.flexslider').flexslider({
animation: "fade",
directionNav: false
});
new WOW().init();
loadGoogleMap();
});
// isotope
jQuery(document).ready(function($){
if ( $('.iso-box-wrapper').length > 0 ) {
var $container = $('.iso-box-wrapper'),
$imgs = $('.iso-box img');
$container.imagesLoaded(function () {
$container.isotope({
layoutMode: 'fitRows',
itemSelector: '.iso-box'
});
$imgs.load(function(){
$container.isotope('reLayout');
})
});
//filter items on button click
$('.filter-wrapper li a').click(function(){
var $this = $(this), filterValue = $this.attr('data-filter');
$container.isotope({
filter: filterValue,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var filter_wrapper = $this.closest('.filter-wrapper');
filter_wrapper.find('.selected').removeClass('selected');
$this.addClass('selected');
return false;
});
}
});
// Hide mobile menu after clicking on a link
$('.navbar-collapse a').click(function(){
$(".navbar-collapse").collapse('hide');
});
//jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
$('.navbar-default a, a,').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top - 68
}, 1000);
event.preventDefault();
});
});