-
Notifications
You must be signed in to change notification settings - Fork 1
/
sarasva.js
43 lines (40 loc) · 1.05 KB
/
sarasva.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
setInterval(changebg,4000);
var x =0;
function changebg(){
if(x == 0)
{
document.querySelector("body").classList.remove("body1");
document.querySelector("body").classList.add("body2");
x = 1;
}
else if(x == 1)
{
document.querySelector("body").classList.remove("body2");
document.querySelector("body").classList.add("body3");
x = 2;
}
else if(x == 2)
{
document.querySelector("body").classList.remove("body3");
document.querySelector("body").classList.add("body1");
x = 0;
}
}
var icone = document.querySelector("img");
var p = document.querySelector("#nav-text-first");
icone.addEventListener("mouseover",function(){
this.setAttribute("src","orange.png");
p.style.color = "orange";
});
icone.addEventListener("mouseout",function(){
this.setAttribute("src","nav-icon.png");
p.style.color = "white";
});
p.addEventListener("mouseover",function(){
icone.setAttribute("src","orange.png");
this.style.color = "orange";
});
p.addEventListener("mouseout",function(){
icone.setAttribute("src","nav-icon.png");
this.style.color = "white";
});