Add a separate button to open the Mobile Nav

Home Forums Latest release 1.1.x Add a separate button to open the Mobile Nav

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8355
    hkcdesign
    Participant

    Hi! I am looking to place a button in the footer so that if someone is on mobile, they can click it and it will open the hamburger menu located in the header. I found some older code on here from 2015, but it’s not working.

    $(‘#menuFooter’).on(‘click’, function() {
    setTimeout(function() {
    $(‘#main-menu’).smartmenus(‘itemActivate’, $(‘li > a’));
    }, 1);
    });

    Can anyone help?

    #8367
    cmsmart
    Participant

    If You look at
    https://www.smartmenus.org/docs/#styling-menus (there : smalll screen devices) You find a code with

    <!– Mobile menu toggle button (hamburger/x icon) –>
    <input id=”main-menu-state” type=”checkbox” />
    <label class=”main-menu-btn” for=”main-menu-state”>
    <span class=”main-menu-btn-icon”></span> Toggle main menu visibility
    </label>

    <h2 class=”nav-brand”>Brand</h2>

    which You can put into the footer (together with the js)

    At https://www.smartmenus.org/about/themes/ You just have to shift the page together into narrow mode and then the button appears in the top nav-line.

    an example is at
    https://jsfiddle.net/vadikom/oxe40pat/?utm_source=website&utm_medium=embed&utm_campaign=oxe40pat

    This will function with some modifications.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Register

You will be emailed a link to set your password.

Login

Lost password?