Home
  • Products Home
  • Products Home
  • Products

    SlikNav multi-level menu on desktop view?

    776 views Asked by At

    I'm using SlikNav to make a mobile navigation menu. I have this structure:

    <nav>
        <ul>
            <li>
                <a href="#">Home</a>
            </li>
            <li>
                <a href="#">Products</a>
                <ul>
                    <li>
                        <a href="#">Child1</a>
                    </li>
                    <li>
                        <a href="#">Child2</a>
                    </li>
                </ul>
            </li>
        </ul>
    </nav>
    

    This works fine on mobile view, here is a codepen.

    My desktop version of this is simply: nav ul li { display:inline; } which makes the list display inline.

    My question, is it possible for SlickNav to make the dropdown menu also work in desktop view?

    2

    There are 2 answers

    0
    AudioBubble On

    right now, the menu is already a dropdown in desktop mode and also in mobile mode..

    Just for looks good, do that - add a class "sub" in ul after li.

    <nav>
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Products</a>
          <ul class="sub">
            <li><a href="#">Child1</a></li>
            <li><a href="#">Child2</a></li>
          </ul>
        </li>
      </ul>
    </nav>
    

    and css -

    li{
      float: left;
    }
    li > ul.sub{
      margin: 0;
    }
    
    0
    Neeraj Pathak On

    I don't know how to do this but I have an alternative and fast solution from this.

    You can use smartmenu Plugin Here is the Example Click Here Preview

    Javascript Code

    HTML Code

    Hope It Helps You.