-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
173 lines (150 loc) · 5.71 KB
/
scripts.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
$(document).ready(function($) {
"use strict";
$(window).scroll(function () {
if ($(document).scrollTop() > 10) {
$(".lightnav .navbar-inner").addClass("lightnav-alt");
$(".darknav .navbar-inner").addClass("darknav-alt");
} else {
$(".lightnav .navbar-inner").removeClass("lightnav-alt");
$(".darknav .navbar-inner").removeClass("darknav-alt");
}
});
$(document).ready(function($) {
// Slidebars off-canvas menu
$.slidebars();
// Popovers [Hover]
// $("[data-toggle=popover]")
// .popover({
// html:true
// }
// );
// Page transitions
$(".animsition").animsition({
inClass : 'fade-in',
outClass : 'fade-out-down-sm',
inDuration : 900,
outDuration : 800,
linkElement : '.animsition-link',
//e.g. linkElement : 'a:not([target="_blank"]):not([href^=#])'
loading : true,
loadingParentElement : 'body', //animsition wrapper element
loadingClass : 'animsition-loading',
unSupportCss : [ 'animation-duration',
'-webkit-animation-duration',
'-o-animation-duration'
],
//"unSupportCss" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser.
//The default setting is to disable the "animsition" in a browser that does not support "animation-duration".
overlay : false,
overlayClass : 'animsition-overlay-slide',
overlayParentElement : 'body'
});
// WOW plugin settings
var wow = new WOW(
{ animateClass: 'animated', // set our global css classT (default is animated)
offset: 250, // set distance to content until it triggers (default is 0)
mobile: false, // remove animations for mobiles/tablets (default is true)
live: true }); // act on asynchronously loaded content (default is true)
new WOW().init();
// Functionailty constraints for mobile
if (!Modernizr.touch) {
jQuery(function ($) {
// Hero & page-header fade-in effect
var divs = $('.herofade');
$(window).on('scroll', function () {
var st = $(this).scrollTop();
divs.css({
'margin-top': -(st / 0) + "px",
'opacity': 0
// 'opacity': 0.9 - st / 1600
});
});
});
jQuery(function ($) {
// Hero & page-header fade-in effect
var divs = $('.videofade');
$(window).on('scroll', function () {
var st = $(this).scrollTop();
divs.css({
'margin-top': -(st / 0) + "px",
'opacity': 0.8 - st / 1600
});
});
});
jQuery(function ($) {
// Hero & page-header fade-in effect
var divs = $('.headerfade');
$(window).on('scroll', function () {
var st = $(this).scrollTop();
divs.css({
'margin-top': -(st / 0) + "px",
'opacity': 0.9 - st / 300
});
});
});
}
// autohide navbar on scroll
$("div.navbar-fixed-top").autoHidingNavbar({
animationDuration: 400,
hideOffset: 0,
});
// faq's floating sidebar (left)
$('#sidebar').affix({
offset: {
top: 500
}
});
// Scrollspy for scrollto links in floating faq sidebar
var $body = $(document.body);
var navHeight = $('.navbar').outerHeight(true) + 80;
$body.scrollspy({
target: '#leftcol',
offset: navHeight
});
// fade out map cover (contact.html)
$(".map-cover").click(function () {
$(".map-cover").fadeOut("slow");
});
// Collapsible panels for faq's and careers
$('.collapse').on('show.bs.collapse', function() {
var id = $(this).attr('id');
$('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-panel');
$('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-chevron-up"></i>');
});
$('.collapse').on('hide.bs.collapse', function() {
var id = $(this).attr('id');
$('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-panel');
$('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-chevron-down"></i>');
});
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014 Twitter, Inc.
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
// See the Getting Started docs for more information:
// http://getbootstrap.com/getting-started/#support-ie10-width
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style');
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
);
document.querySelector('head').appendChild(msViewportStyle);
}
}); // Document Ready
}(jQuery)); // End "use strict"
// Enable dropdown sub-menus in off-canvas navigation
$(document).ready(function($) {
$('.sb-toggle-submenu').off('click') // Stop submenu toggle from closing Slidebars.
.on('click', function() {
$submenu = $(this).parent().children('.sb-submenu');
$(this).add($submenu).toggleClass('sb-submenu-active'); // Toggle active class.
if ($submenu.hasClass('sb-submenu-active')) {
$submenu.slideDown(200);
} else {
$submenu.slideUp(200);
}
});
});