-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.js
131 lines (118 loc) · 3.49 KB
/
functions.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// PARALLAX EFFECT
function EasyPeasyParallax() {
scrollPos = $(this).scrollTop();
$('#section-1').css({
'background-position' : '50% ' + (-scrollPos/4)+"px"
});
$('#title-1').css({
'opacity': 1-(scrollPos/450)
});
}
$(document).ready(function(){
$(window).scroll(function() {
EasyPeasyParallax();
});
});
// STICKY NAV
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$('.main_h').addClass('sticky');
} else {
$('.main_h').removeClass('sticky');
}
});
// Mobile Navigation
$('.mobile-toggle').click(function() {
if ($('.main_h').hasClass('open-nav')) {
$('.main_h').removeClass('open-nav');
} else {
$('.main_h').addClass('open-nav');
}
});
$('.main_h li a').click(function() {
if ($('.main_h').hasClass('open-nav')) {
$('.navigation').removeClass('open-nav');
$('.main_h').removeClass('open-nav');
}
});
// SMOTH SCROLL
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1200);
return false;
}
}
});
});
// MAKE SELECTED ELEMENTS THE SAME HEIGHT
$(function() {
$('.column').matchHeight();
});
$(function() {
$('.column2').matchHeight();
});
$(function() {
$('.column3').matchHeight();
});
$(function() {
$('.column4').matchHeight();
});
$(function() {
$('.column5').matchHeight();
});
$(function() {
$('.column6').matchHeight();
});
$(function() {
$('.column7').matchHeight();
});
// animation wow js
var wow = new WOW(
{
boxClass: 'wow', // animated element css class (default is wow)
animateClass: 'animated', // animation css class (default is animated)
offset: 200, // distance to the element when triggering the animation (default is 0)
mobile: true, // trigger animations on mobile devices (default is true)
live: true, // act on asynchronously loaded content (default is true)
callback: function(box) {
// the callback is fired every time an animation is started
// the argument that is passed in is the DOM node being animated
},
scrollContainer: null // optional scroll container selector, otherwise use window
}
);
wow.init();
// ANIMISTION
$(document).ready(function() {
$('.animsition-overlay').animsition({
inClass: 'overlay-slide-in-bottom',
outClass: 'overlay-slide-out-top',
overlay : true,
overlayClass : 'animsition-overlay-slide',
overlayParentElement : 'body'
})
.one('animsition.inStart',function(){
$('body').removeClass('bg-init');
$(this)
.find('.item')
.append('<h2 class="target">Callback: Start</h2>');
console.log('event -> inStart');
})
.one('animsition.inEnd',function(){
$('.target', this).html('Callback: End');
console.log('event -> inEnd');
})
.one('animsition.outStart',function(){
console.log('event -> outStart');
})
.one('animsition.outEnd',function(){
$('.target', this).html('Callback: End');
console.log('event -> outEnd');
});
});