Search code examples
materialize

Create two Side Navs in materialize css


I want to have two side navs which are triggered from different directions of the screen using materialize css. How should I initialize the two different side navs as I have to use different options for them?

$('.sidenav').sidenav();

How should I initialize another sidenav, its because I want to have different options for them? I have tried using a different class name which didn't work. Please suggest some ideas.


Solution

  • I solved my problem, by specifying a separate class my other side nav. It seems that the class sidenav has to present for the sidenav to function properly. So I created a class and solved my problem as

    $('.sidenav.my-side-nav-1').sidenav(options1);
    

    and similarly I have my other sidenav as

    $('.sidenav.my-side-nav').sidenav(options2);