-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (21 loc) · 698 Bytes
/
Copy pathscript.js
File metadata and controls
27 lines (21 loc) · 698 Bytes
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
$(window).scroll(function() {
$("header").css("background-color" , "#799959");
});
$(window).on("scroll", function () {
if ($(this).scrollTop() > 200) {
$("header").css({ background: "#799959" });
$("header ul li a").css({ color: "white" });
} else {
$("header").css({background: "#799959" } );
$("header ul li a").css({ color: "black" });
}
});
let switchMode=document.getElementById("switchMode");
switchMode.oneclick=function(){
let theme=document.getElementById("theme");
if(theme.getAttribute("href")=="./css/light-mode.css"){
theme.href="./css/dark-mode.css";
}else{
theme.href="./css/light-mode.css"
}
}