-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
157 lines (134 loc) · 4.17 KB
/
main.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// Hello.
//
// This is The Scripts used for ___________ Theme
//
//
function main() {
(function () {
'use strict';
// Smooth Scrolling
//==========================================
$(function() {
$('a.scroll').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 -50
}, 1000);
return false;
}
}
});
});
/*====================================
Script for the Counters for Facts Section
======================================*/
$('.count').each(function() {
var $this = $(this);
$this.data('target', parseInt($this.html()));
$this.data('counted', false);
$this.html('0');
});
$(window).bind('scroll', function() {
var speed = 3000;
$('.count').each(function() {
var $this = $(this);
if (!$this.data('counted') && $(window).scrollTop() +
$(window).height() >= $this.offset().top) {
$this.data('counted', true);
$this.animate({
dummy: 1
}, {
duration: speed,
step: function(now) {
var $this = $(this);
var val = Math.round(
$this.data(
'target') *
now);
$this.html(val);
if (0 < $this.parent(
'.value').length) {
$this.parent(
'.value').css(
'width',
val + '%');
}
}
});
}
});
}).triggerHandler('scroll');
/*====================================
Portfolio Carousel
======================================*/
$(document).ready(function() {
var owl = $("#team");
owl.owlCarousel({
itemsCustom : [
[0, 1],
[450, 1],
[660, 2],
[700, 2],
[1200, 3],
[1600, 3]
],
navigation : false,
pagination: true,
});
});
/*====================================
Portfolio Isotope Filter
======================================*/
$(window).load(function() {
var $container = $('#itemsWork , #itemsWorkTwo, #itemsWorkThree');
$container.isotope({
filter: '* , all',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
$('.cat a').click(function() {
$('.cat .active').removeClass('active');
$(this).addClass('active');
var selector = $(this).attr('data-filter');
$container.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
return false;
});
});
/*====================================
Nivo Lightbox
======================================*/
// Agency Portfolio Popup
$('#itemsWork a , #itemsWorkTwo a , #itemsWorkThree a , #popup a').nivoLightbox({
effect: 'slideDown',
keyboardNav: true,
});
$(document).ready(function() {
$("#owl-demo").owlCarousel({
navigation : false, // Show next and prev buttons
slideSpeed : 300,
paginationSpeed : 400,
singleItem:true
// "singleItem:true" is a shortcut for:
// items : 1,
// itemsDesktop : false,
// itemsDesktopSmall : false,
// itemsTablet: false,
// itemsMobile : false
});
});
}());
}
main();