-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
43 lines (40 loc) · 1.08 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
if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){
skrollr.init({
forceHeight: false,
smoothScrolling: false
});
}
$(function(){
var windowH = $(window).height() - 60;
$(window).on('resize', function(){
windowH = $(window).height() - 60;
});
$(window).scroll(function() {
var scrollVal = $(this).scrollTop();
if ( scrollVal > windowH ) {
$('.navbar').addClass('navbar-fixed-top');
$('.main').css({'margin-top': '70px'});
} else {
$('.navbar').removeClass('navbar-fixed-top');
$('.main').css({'margin-top': 0});
}
});
});
$('#nav-brand').click(function() {
$('html, body').animate({
scrollTop: $(".logo").offset().top - 40
}, 400);
return false;
});
$("#nav-about").click(function() {
$('html, body').animate({
scrollTop: $(".about").offset().top - 70
}, 400);
return false;
});
$("#nav-faq").click(function() {
$('html, body').animate({
scrollTop: $(".faq").offset().top - 70
}, 400);
return false;
});