Home Forums Basel support forum Make some mobile sidebar menu items open sub-menu

Make some mobile sidebar menu items open sub-menu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #74882

    shadyrad
    Participant

    Hi,

    In the sidebar menu I have some parent menu items without links, because I don’t want people to go to these high level categories. I want people to navigate to sub menu items. To make it more user friendly, I would like the menu items to work like the dropdowns on the side (<span class=”icon-sub-menu”></span>) – if user clicks on them, the sub-menu will open.

    For example, if user clicks straight on “Ženy” or “Podle kategorie” (not just the arrow, but the text itself – .menu-item > a ), it’s submenu would open. – please see the screenshot

    Now I only added menu items without a link.

    I think it could work if I add a certain class to all these menu items and add some javascript snippet. Could you please help me with the snippet?

    I tried to play with the function mobileNavigation in your theme, but to no luck so far.

    Thank you for any help.

    Kind regards
    Radim

    Attachments:
    You must be logged in to view attached files.
    #74896

    Artem Temos
    Keymaster

    Hi,

    Try to add the following code snippet to the Custom JS area on a document ready in Theme Settings to do this

    jQuery('.mobile-nav').on('click', '.menu-item a:not([href])', function(e) {
    	e.preventDefault();
    	jQuery(this).parent().find('>.icon-sub-menu').click();
    })

    Regards

    #74981

    shadyrad
    Participant

    Fantastic, it works :).

    Thanks Artem

    #74997

    Artem Temos
    Keymaster

    You are welcome, we are always happy to help you, write us when you have any difficulties or issues with our theme.

    And we would be glad if you will rate our theme with 5 stars on Theme Forest in case you are satisfied with our theme and customer service http://themeforest.net/downloads

    Thank you in advance 🙂

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)