Jumping to parent menu item when clicking caret to close submenu

Home Forums Older releases 1.0.x + Bootstrap addon Jumping to parent menu item when clicking caret to close submenu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3103
    caramaple
    Participant

    Hi there,

    I integrated SmartMenus with Bootstrap/WordPress – it all works great, but when I click the caret (which is the a::after) to close the submenu again, it closes the submenu, but also links/jumps directly to the parent page instead of only toggling the submenu.

    If I click not right on the caret, but anywhere out of the link area it closes/toggles the submenu without any problems.

    For any insights how to solve the problem, I would be very grateful!

    #3107
    admin
    Keymaster

    Hi,

    If you are using the Bootstrap addon, you need to use <span class="caret"></span> inside the parent item links for the carets and then it should work fine. Because when you add the carets via CSS with a::after the script cannot differentiate between a click on the link and the caret pseudo element.

    Cheers!

    #3110
    caramaple
    Participant

    Thanks so much for your answer! Yes, I read about this in your tutorial section “Upgrading SmartMenus jQuery + Bootstrap add-on”.

    Yet, I am using the Bootstrap addon with WordPress, so I am not quite sure where to place the <span>. Do you know of any site where SmartMenus is integrated with Bootstrap and WordPress, so I could have a look?

    I tried to append the <span> with jQuery, but then the same happens, – clicking on the minus to close the sub-menu links to the parent page. Only if I clock outside the a, then it closes.

    Happy for any other hints 😉 – thanks!

    #3111
    caramaple
    Participant

    So, I integrated a custom navwalker (https://github.com/twittem/wp-bootstrap-navwalker) and got it working!

Viewing 4 posts - 1 through 4 (of 4 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?