Materialize fixed-sidebar close
问题 I have a Materialize fixed sidenav which is visible all time. I want to add button which will open and close it. If I add $('.sidenav').sidenav('close') to the button it can only close the sidebar; similarly with $('.sidenav').sidenav('open') . I do not want make two buttons. How can I solve this? This is function which intializes the sidebar: $(document).ready(function () { $('.sidenav').sidenav(); }); Here's my HTML: <ul id="slide-out" class="sidenav sidenav-fixed"> <li> <div class="user