Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #760462

    eganlohman
    Participant

    Hi Staff,

    In the mega menu, I want to change the default behavior of having to double click parent nav elements. Do you have any suggestions on how to make those links single click?

    Cheers,

    Egan

    #761089

    Rue Nel
    Moderator

    Hello Egan,

    Thanks for writing in!

    The mega menu should be working when you hover in your parent menu item. Upon checking, there is a JS error in your site. It turns out that you have inserted an invalid JS code in your customizer. Please update your code by using this code instead:

    jQuery(document).ready(function($) {
      var hash = location.href.split("#").slice(-1)[0]; 
      var outbound = /^https?:///i;
      var $adminbarHeight = $('#wpadminbar').outerHeight();
      var $navbarHeight   = $('.x-navbar').outerHeight();
      if( hash && !outbound.test( hash ) ) {
        if( $('#' + hash ).length > 0 ) {
           $('[href="#' + hash +'"]').click();
    	   var scrollToPosition = $('#' + hash ).offset().top - $adminbarHeight - $navbarHeight + 1; 
    	   $('html,body').animate({scrollTop:   scrollToPosition }, 700, function(){
              window.location.hash = "" + '#' + hash;
              // This hash change will jump the page to the top of the div with the same id
            // so we need to force the page to back to the end of the animation
            $('html,body').animate({ 'scrollTop': scrollToPosition }, 0);
    	});
        }
      }
    })

    Hope this helps. Please let us know how it goes.

    #761159

    eganlohman
    Participant

    Hi Staff,

    Nice catch! I must have fat fingered a paste of that css into the javascript section. Unfortunately, that wasn’t my issue. What I’m trying to “fix” isn’t a bug per-se, it’s how the theme was designed. But I want the top level nav elements within the megamenu to be single click not double click. So for instance, on my site, under About, there are two top level elements:

    1. About This Site
    2. About The Authors

    Clicking on either of those nav elements doesn’t result in a page change. Double clicking however, will. I want to switch that so a single click initiates the redirect.

    Cheers,

    Egan

    #761983

    Lely
    Moderator

    Hello Egan,

    Menu link is always accessible by a single click. I did try your site and it is working on a single click. See video screencast:http://screencast-o-matic.com/watch/cDVZ0ghJPp