How to close sidebar menu when click outside of it using html, css & javascript.
ฝัง
- เผยแพร่เมื่อ 29 ก.ย. 2024
- In this video, I will show you how to close a sidebar menu when a user clicks outside of it using HTML, CSS, and JavaScript. This is a great way to improve the user experience of your website or web application.
We will start by creating an HTML sidebar menu. Then, we will add some CSS to style the sidebar menu. Finally, we will write some JavaScript code that will listen for the click event outside of the sidebar menu and close the menu accordingly.
For Source Code visit:
www.maketechst...
You may have to search ('menu') on website.
Bien explicado... genial el vídeo!! Saluditos desde Mty
Great Thing To Show Us!
You know you could have just cut out the first part 😏
How come you don't use a links to create the nav bar
How know the background music 😂😂😂😂😂😂😂😂😂😂😂
can you simply add ".active" before another class name on CSS, without defining it first on HTML?
Yes you can add, but if that another class is not in html, then styles will not applied to it. or may be show error, when you add that active class using javascript.
@@Maketechstuffs why it dons't work on mine in vscode i followed the steps but it didn't work broooooooooooooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Source code available on maketechstuff.com website. You can compare both the codes (yours and mines).
Finally.. thanks sir ❤️
Please what's the purpose of that .active class you add to it?
I've explained in blog post. www.maketechstuff.com/2022/11/close-sidebar-menu-when-click-outside-of-it.html
Perfect 👌
It works, thanks
You're welcome!
thank you
You're welcome