-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·90 lines (71 loc) · 1.99 KB
/
Copy pathscript.js
File metadata and controls
executable file
·90 lines (71 loc) · 1.99 KB
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
$(document).ready(function(){
/*
For the sticky Nav
*/
$('.js--section-features').waypoint(function(direction){
if(direction =="down"){
$('nav').addClass('sticky');
} else {
$('nav').removeClass('sticky');
}
}, {
offset: '25%'
});
/*
For the smooth scroll
*/
$('.js--scroll-to-plans').click(function(){
$('html, body').animate({scrollTop:$('.js--section-plans').offset().top}, 1000);
});
$('.js--scroll-to-start').click(function(){
$('html, body').animate({scrollTop:$('.js--section-features').offset().top}, 1000);
});
$('.js--scroll-to-home').click(function(){
$('html, body').animate({scrollTop:$('.js--section-home').offset().top-500}, 1000);
});
/* navagation scroll*/
$('a[href*="#"]')
.not('[href="#"]')
.not('[href="#0"]')
.click(function(event) {
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) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 1000, function() {
var $target = $(target);
$target.focus();
if ($target.is(":focus")) {
return false;
} else {
$target.attr('tabindex','-1');
$target.focus();
};
});
}
}
});
/*animations on scroll*/
$('.js--wp-1').waypoint(function(direction){
$('.js--wp-1').addClass('animated fadeInDown');
},{
offset: '70%'
});
$('.js--wp-2').waypoint(function(direction){
$('.js--wp-2').addClass('animated fadeInLeft');
},{
offset: '70%'
});
$('.js--wp-3').waypoint(function(direction){
$('.js--wp-3').addClass('animated slideInUp');
},{
offset: '70%'
});
});