Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #910467
    michele
    Participant

    Hi, I noticed that my one page navigation on mobile is not in line properly, – I was advised to add this code to custom css, but unfortunately it hasn’t worked.

    .x-btn-navbar {
    margin-top: 50px;
    }

    Thank you in advance
    Michele

    #910471
    michele
    Participant
    This reply has been marked as private.
    #910697
    Christopher
    Moderator

    Hi there,

    Please add this code in Customize -> Custom -> JavaScript :

    jQuery(document).ready(function($) {
       function belowMastheadArrow() {
          var $body           = $('body');
          var $bodyHeight     = $body.outerHeight();
          var $adminbarHeight = $('#wpadminbar').outerHeight();
          var $navbarHeight   = $('.x-navbar').outerHeight();
    
          var scrollSpyLinks = $('.x-nav-scrollspy > li > a[href^="#"]');
          if ($(window).width() <= 979) {
             scrollSpyLinks.off('click'); 
             scrollSpyLinks.click(function(e) {
                e.preventDefault();
                var $contentBand = $(this).attr('href');
                $('html, body').animate({
                   scrollTop: $($contentBand).offset().top + 1
                }, 850, 'easeInOutExpo');
             });
          } else {
             scrollSpyLinks.off('click'); 
             scrollSpyLinks.click(function(e) {
                e.preventDefault();
                var $contentBand = $(this).attr('href');
                $('html, body').animate({
                   scrollTop: $($contentBand).offset().top - $adminbarHeight - $navbarHeight + 1
                }, 850, 'easeInOutExpo');
             });
          }
       }
    
       belowMastheadArrow();
    
       $(window).resize(belowMastheadArrow);
    });

    Hope it helps.

    #911932
    michele
    Participant

    Hi Christopher, I added the code, but the mobile navigation is still off a bit- sorry.

    Michele

    #912296
    Christian
    Moderator

    Can you give us more details by what you mean by “a bit off”. A video recording would be a great help.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-910467 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>