-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.js
53 lines (41 loc) · 1.21 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
// PRELOADER JS
$(window).load(function(){
$('.preloader').fadeOut(500); // set duration in brackets
});
// MAIN NAVIGATION
$('.main-navigation').onePageNav({
scrollThreshold: 0.1, // Adjust if Navigation highlights too early or too late
scrollOffset: 75, //Height of Navigation Bar
filter: ':not(.external)',
changeHash: true
});
/* NAVIGATION VISIBLE ON SCROLL */
mainNav();
$(window).scroll(function () {
mainNav();
});
function mainNav() {
var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
if (top > 40) $('.sticky-navigation').stop().animate({
"opacity": '1',
"top": '0'
});
else $('.sticky-navigation').stop().animate({
"opacity": '0',
"top": '-75'
});
}
// HIDE MOBILE MENU AFTER CLIKING ON A LINK
$('.navbar-collapse a').click(function(){
$(".navbar-collapse").collapse('hide');
});
/* HTML document is loaded. DOM is ready.
-------------------------------------------*/
$(function(){
// ------- WOW ANIMATED ------ //
wow = new WOW(
{
mobile: false
});
wow.init();
});