+ 1
Did someone know how to fadeOut everything whit a button?
I want to make that when you press a button everything fadeOut
3 ответов
+ 7
Yes, write a class in CSS with opacity 0 then add it via Javascript to the target element. It should work fade that element.
Check the below demo modify to your use case
https://code.sololearn.com/WmTAs8Y8tzWX/?ref=app
+ 3
I have added some comments that may help. if you don't understand them then read & learn about DOM(document object model), eventlisteners.
Read this article to get familiar with DOM
https://zellwk.com/blog/js-in-dom/
Read about event listeners from below resources
https://www.w3schools.com/js/js_htmldom_eventlistener.asp
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
After reading them read the code(save it private) and ask for specific doubts if any.
+ 1
Can You explain me how it works so i can implement it in my code