+ 1

Javascript error in my demo

-Desc: My demo is about a sleeping Owl and if you click on it, its eyes will go from sleep to wake and follow the cursor. -Errors: + Owl Pupil doesn't create and add new global style .wake when clicked + Owl Pupil doesn't follow cursor This is my code link: https://code.sololearn.com/WqCrbpJpWUUV

1st Sep 2021, 5:21 AM
MasterofBeginning
MasterofBeginning - avatar
3 ответов
+ 1
I would suggest you to already add the .wake style in the css and only add the class to the element when clicking on it.
3rd Sep 2021, 4:18 AM
Maisu
Maisu - avatar
+ 1
Can you explain me why my pupil doesn't follow to cursor
3rd Sep 2021, 4:42 AM
MasterofBeginning
MasterofBeginning - avatar
+ 1
MasterofBegining Change line 50 to: let mouseOffset = { x: e.clientX, y: e.clientY };
3rd Sep 2021, 9:52 AM
Maisu
Maisu - avatar