100-project-100-days-website/100_projects/95-section-landing-page/main.js

8 lines
473 B
JavaScript
Raw Normal View History

2023-05-27 09:36:13 +03:00
const content = document.querySelector(".content");
const left = document.querySelector(".left");
const right = document.querySelector(".right");
left.addEventListener('mouseenter', () => content.classList.add('hover-left'))
left.addEventListener('mouseleave', () => content.classList.remove('hover-left'))
right.addEventListener('mouseenter', () => content.classList.add('hover-right'))
right.addEventListener('mouseleave', () => content.classList.remove('hover-right'))