-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (27 loc) · 970 Bytes
/
script.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
const barra = document.querySelector("#barra");
const baner = document.querySelector("#baner");
const slider = document.querySelector(".slider");
const bmenu = document.querySelector(".menu");
const menu = document.querySelector("#menu-bar");
const menua = document.querySelectorAll("#menu-bar a");
const fundo = document.querySelector("#menu-bar .fundo");
function menuAla(){
menu.classList.toggle("estender");
};
window.addEventListener('scroll',function(){
if (window.pageYOffset <= baner.offsetTop + baner.offsetHeight) {
barra.classList.remove("estender");
}
else{
barra.classList.add("estender");
}
});
bmenu.addEventListener("click", menuAla);
menua.forEach(a => {
a.addEventListener("click", menuAla);
});
fundo.addEventListener("click", menuAla);
setInterval(function(){
var img = document.querySelectorAll(".slider img")
slider.insertBefore(img[0],img[img.length]);
},6000);