forked from prettierlichess/prettierlichess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postLoad.js
31 lines (26 loc) · 948 Bytes
/
postLoad.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
//Top Navigation
const TAB_SELECTOR = document.querySelectorAll('#topnav section>a');
const TAB_GROUP = document.querySelectorAll('[role="group"]');
// Navbar Animations
TAB_SELECTOR.forEach((item, index) => {
item.addEventListener('mouseenter', e => {
if (item.nextSibling == TAB_GROUP[index]) {
item.nextSibling.classList.add('topnavHover');
}
})
item.addEventListener('mouseleave', e => {
if (item.nextSibling == TAB_GROUP[index]) {
item.nextSibling.classList.remove('topnavHover');
}
})
item.nextSibling.addEventListener('mouseenter', e => {
if (item.nextSibling == TAB_GROUP[index]) {
item.nextSibling.classList.add('topnavHover');
}
})
item.nextSibling.addEventListener('mouseleave', e => {
if (item.nextSibling == TAB_GROUP[index]) {
item.nextSibling.classList.remove('topnavHover');
}
})
})