GrassClipper/resources/js/hoverEvt.js
2022-04-22 15:34:24 -07:00

21 lines
596 B
JavaScript

document.addEventListener('DOMContentLoaded', async () => {
const firstPanel = document.querySelector('#firstPanel')
const secondPanel = document.querySelector('#secondPanel')
// Listen to hovers
firstPanel.addEventListener('mouseover', () => {
secondPanel.classList.add('darken')
})
firstPanel.addEventListener('mouseout', () => {
secondPanel.classList.remove('darken')
})
secondPanel.addEventListener('mouseover', () => {
firstPanel.classList.add('darken')
})
secondPanel.addEventListener('mouseout', () => {
firstPanel.classList.remove('darken')
})
})