• Resolved pagasts

    (@pagasts)


    Menu opens when hitting the back button on a browser.

    Scenario – Open a menu, click on one of the menu links, visit a page and by clicking on the back button on a browser – the menu would open again while in the background the previous page is loaded.

    So you are forced to close the menu to see the page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Solitweb

    (@solitweb)

    This is a normal behavior. If you hit the back button on a browser, you go back to the previous state. So, if the menu was open it will be open when you hit the back button.

    This is a subjective thing. It would also be very normal to NOT have the menu open when going back.

    Ultimately, ideally it would be good to have such an option… to determine which style of back functionality you want.

    Thread Starter pagasts

    (@pagasts)

    I agree it would be great to have an option for going back without opening the menu.

    Plugin Author Solitweb

    (@solitweb)

    Since we’re using only CSS we use a checkbox/label under the hood. When you check a checkbox and go forward/back in the browser the checkbox is still checked. That’s just the behaviour of a checkbox.

    Only jQuery/Javascript could fix this ‘issue’.

    Plugin Author Solitweb

    (@solitweb)

    This code snipped will close the menu when an anchor tag is clicked. So when you hit the back button in the browser the menu will be closed.

    
    ( function() {
      jQuery( document ).ready( function() {
        jQuery( ".fsmfe-wrapper" ).find( "a" ).click( function() {
          jQuery( this ).closest( ".fsmfe-wrapper" ).find( ".menu-toggle" ).prop( "checked", false );
        } );
      } );
    }() );
    

    Use some plugin like Simple Custom CSS and JS to add the snipped to your sites footer.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Menu opens when hitting the back button on a browser’ is closed to new replies.