Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Uplift
  • #278872
    ronin
    Member
    Post count: 282

    Hi,

    We’ve created a mega menu with the parent page link at the top, followed by anchor points located on that page. This works fine, but I have two questions:

    1) If you’re already on the parent page and try to navigate to one of the anchor points, the mega menu stays visible above the content. Is there a way to hide the menu on click?

    2) I’ve set an offset for the anchor, so that the menu doesn’t hide the top of the linked section. However we’re using the fancy page heading on every page, and so the offset becomes incorrect as it’s correct on page load, but then the page heading pushes everything down. Is there some sort of code we can use to work around this?

    Thanks

    #279511
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi Ronin,

    1) You’d probably need to write some custom JS – that checks if the link has a hashtag in it, and then if so, hide the “.mega-sub-menu” parent of that link. We can try and assist if you need help.

    2) I’d recommend removing the slide in effect, you can do so with this css:

    @media only screen and (min-width: 768px) {
    .fancy-style .page-heading.fancy-heading {
    height: 472px!important;
    }
    }

    – Ed

    #279598
    ronin
    Member
    Post count: 282

    Thanks for the help, Ed. Unfortunately I don’t have much javascript knowledge, would you be able to point me in the right direction.

    Much appreciated.

    #280157
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    As they are custom links you’ve made with HTML. Add a class to each link you want to trigger the mega menu close. i.e. ‘mega-menu-close’.

    Then you can try this JS:

    jQuery(document).ready(function() {
    jQuery(document).on('click', '.mega-menu-close', function(e) {
    e.preventDefault();
    jQuery(this).parents('.mega-sub-menu').hide(400);
    return e;
    });
    });
    

    – Ed

    #281386
    ronin
    Member
    Post count: 282

    Thanks so much for the help Ed, I really appreciate it. However, this seems to close the menu before being taken to the link. Any help would be amazing.

    #281481
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hmm, can you try changing it to this please:

    jQuery(document).ready(function() {
    jQuery(document).on('click', '.mega-menu-close', function() {
    jQuery(this).parents('.mega-sub-menu').hide(400);
    });
    });

    – Ed

    #282148
    ronin
    Member
    Post count: 282

    Perfect! Thanks so much Ed, you’ve been a big help.

    #282180
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to Ed.
    Mohammad

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

You must be logged in to reply to this topic.