-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscript.js
More file actions
25 lines (18 loc) · 958 Bytes
/
Copy pathscript.js
File metadata and controls
25 lines (18 loc) · 958 Bytes
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
const left = document.querySelector('.left')
const right = document.querySelector('.right')
const container = document.querySelector('.container')
left.addEventListener('mouseenter', () => container.classList.add('hover-left'))
left.addEventListener('mouseleave', () => container.classList.remove('hover-left'))
right.addEventListener('mouseenter', () => container.classList.add('hover-right'))
right.addEventListener('mouseleave', () => container.classList.remove('hover-right'))
/*
order of creation and resources
1- declaring constants variables in JS.
- https://www.javascripttutorial.net/es6/javascript-const/
2- JS querySelector
- https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
3- adding an Event listener.
-https://www.javatpoint.com/javascript-addeventlistener
4- arrow functions
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
*/