Pro One Page Navigation/Sticky Menu scrolls past section

Working in Pro- I have a page set to One Page Navigation with a Sticky Menu and each menu item scrolls past the section ID it is set to go to. And the menu highlights don’t track correctly.

I had fixed this in X with some JS provided by you.

Can you help?

Thanks-
Mike

Hi There,

Although One Page Navigation is still not officially integrated with our header builder, please provide your URL so we can take a closer look and possibly provide you a solution.

Thanks

Hi Mike,

I checked console and there are some js errors.

Please change your js script in Header > JS from

jQuery(document).ready(function($) {
  if ( $('body').hasClass('x-one-page-navigation-active') ) {
    $(function(){
      $('.x-nav-tabs-item').on('click touchstart', function() {
        setTimeout(function() {
          $(window).trigger('resize');
        }, 500);
      });
    });
}

to this

jQuery(document).ready(function($) {
  if ( $('body').hasClass('x-one-page-navigation-active') ) {
    $(function(){
      $('.x-nav-tabs-item').on('click touchstart', function() {
        setTimeout(function() {
          $(window).trigger('resize');
        }, 500);
      });
    });
}
  });

Thanks

Yeah, doesn’t work anymore.

This seems to work except for the first click. Any suggestions?

/*––Fix menu scrolling to section top––*/

(function($)
    { $( document ).ready( function()
        {
        $('.x-anchor.x-anchor-menu-item[href*="#"]').off();
        $(document).on('click', '.x-anchor.x-anchor-menu-item[href*="#"]', function(e)
            {
                e.preventDefault();
                console.log( $(this).attr('href') );
                var hash = '#' + $(this).attr('href').split('#')[1];
                if ( hash == '#' ) return false; $('html, body').stop().animate(
                {
                    scrollTop : $(hash).offset().top - $('.x-bar-fixed').height()
                });
            });
        });
})
(jQuery);

Hi There,

Please provide your login credentials so we can take a closer look.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.