-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
59 lines (46 loc) · 1.43 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// UMANG CODE------------
// search bar
function searchToggle(obj, evt){
var container = $(obj).closest('.search-wrapper');
if(!container.hasClass('active')){
container.addClass('active');
evt.preventDefault();
}
else if(container.hasClass('active') && $(obj).closest('.input-holder').length == 0){
container.removeClass('active');
// clear input
container.find('.search-input').val('');
}
}
/* header sticky ------------*/
const header = document.querySelector("[data-header]");
window.addEventListener("scroll", function () {
if (window.scrollY >= 10) {
header.classList.add("active");
} else {
header.classList.remove("active");
}
}
);
//nav bar colour change
let navigation = document.getElementById('navBar');
function f12(){
navigation.style.backgroundColor= " rgba(01, 01, 01, 0.0)";
}
function f1(){
navigation.style.backgroundColor="linear-gradient(whitesmoke, black)";
setTimeout(f12,1000);
}
function f2(){
navigation.style.backgroundColor="#ff2712";
setTimeout(f12,900);
}function f3(){
navigation.style.backgroundColor="#e7801a";
setTimeout(f12,900);
}function f4(){
navigation.style.backgroundColor="#05037c";
setTimeout(f12,900);
}function f5(){
navigation.style.backgroundColor="#605a5a";
setTimeout(f12,900);
}