GrassClipper/resources/js/hoverEvt.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

document.addEventListener('DOMContentLoaded', async () => {
2022-05-03 05:48:03 +00:00
const firstPanel = document.querySelector('#firstPanel')
const secondPanel = document.querySelector('#secondPanel')
const thirdPanel = document.querySelector('#thirdPanel')
2022-05-03 05:48:03 +00:00
// Listen to hovers
firstPanel.addEventListener('mouseover', () => {
secondPanel.classList.add('darken')
thirdPanel.classList.add('darken')
})
2022-05-03 05:48:03 +00:00
firstPanel.addEventListener('mouseout', () => {
secondPanel.classList.remove('darken')
thirdPanel.classList.remove('darken')
})
2022-05-03 05:48:03 +00:00
secondPanel.addEventListener('mouseover', () => {
firstPanel.classList.add('darken')
thirdPanel.classList.add('darken')
})
2022-05-03 05:48:03 +00:00
secondPanel.addEventListener('mouseout', () => {
firstPanel.classList.remove('darken')
thirdPanel.classList.remove('darken')
})
2022-04-22 22:35:37 +00:00
2022-05-03 05:48:03 +00:00
thirdPanel.addEventListener('mouseover', () => {
firstPanel.classList.add('darken')
secondPanel.classList.add('darken')
})
2022-04-22 22:35:37 +00:00
2022-05-03 05:48:03 +00:00
thirdPanel.addEventListener('mouseout', () => {
firstPanel.classList.remove('darken')
secondPanel.classList.remove('darken')
})
})