-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (28 loc) · 880 Bytes
/
index.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
var targetpageButton = [];
var count = 1;
var myNavBar = document.querySelector('.navbar');
var features = document.querySelectorAll('.features-col');
var socialIcons = document.querySelector('footer');
targetpageButton = document.querySelectorAll('.btn');
window.addEventListener('scroll', function() {
if ( window.scrollY >= 10 ) {
myNavBar.classList.add('navbarscroll');
}
else {
myNavBar.classList.remove('navbarscroll');
}
});
document.querySelector('.navbar-toggler').addEventListener('click', function(){
count++;
if(count % 2 == 0 || window.scrollY >= 10) {
myNavBar.classList.add('navbarscroll');
}
else {
myNavBar.classList.remove('navbarscroll');
}
});
for(var i = 0; i < 2; i++) {
targetpageButton[i].addEventListener('click', function(){
window.location.href = "payment.html";
});
}