-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustom.js
99 lines (92 loc) · 2.44 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
$(function () {
$("#tabs").tabs();
if ($('.owl-trusted').length) {
$('.owl-trusted').owlCarousel({
loop: true,
nav: false,
dots: true,
items: 4,
margin: 30,
autoplay: false,
smartSpeed: 700,
autoplayTimeout: 6000,
responsive: {
0: {
items: 1,
margin: 0
},
460: {
items: 2,
margin: 0
},
576: {
items: 3,
margin: 20
},
992: {
items: 4,
margin: 30
}
}
});
}
if ($('.owl-testimonials').length) {
$('.owl-testimonials').owlCarousel({
loop: true,
nav: false,
dots: true,
items: 1,
margin: 30,
autoplay: false,
smartSpeed: 700,
autoplayTimeout: 6000,
responsive: {
0: {
items: 1,
margin: 0
},
460: {
items: 1,
margin: 0
},
576: {
items: 1,
margin: 20
},
992: {
items: 1,
margin: 30
}
}
});
}
});
$(window).scroll(function(){
$('nav').toggleClass('scrolled', $(this).scrollTop() > 480)
});
// Page loading animation
$(window).on('load', function () {
if ($('.cover').length) {
$('.cover').parallax({
imageSrc: $('.cover').data('image'),
zIndex: '1'
});
}
$("#preloader").animate({
'opacity': '0'
}, 600, function () {
setTimeout(function () {
$("#preloader").css("visibility", "hidden").fadeOut();
}, 300);
});
});
$(window).scroll(function () {
var scroll = $(window).scrollTop();
var box = $('.header-text').height();
var header = $('header').height();
if (scroll >= box - header) {
$("header").addClass("background-header");
} else {
$("header").removeClass("background-header");
}
});