iron3795 iron3795 - 5 months ago 21
jQuery Question

How Do i Open and Close Leftside navbar with click on Logo of website

I have an issue with my web pages in which I want to toggle the left side navigation bar open and close both by clicking on Logo of the web page. but
i am not able to do same, but unfortunately, i am able to open the navbar with
click on Logo but not able to do same for close navbar by click on the logo (instead it close by click on outside area of navbar), so i
have tried some of the code of my web page which is available in jsfiddle snippet in
following. it is good for me if anyone can able to solve this

Note: Please Check Following Jsfiddle for understanding it better.


https://jsfiddle.net/v2a7xdmr/

Answer Source

Check the fiddle at https://jsfiddle.net/Lfa6vef6/2/ - this seems to be what you want to do. Track if the sidebar is expanded or not in a variable and use its value to either invoke openNav or closeNav to toggle the sidebar.