Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1124330
    armintz
    Participant

    i’m currently using the following custom link for my ‘home’ link in the nav menu:

    /#cs-content

    the reason i do this is because i have a video above the masthead on the home page and it wouldn’t be good user experience to send the user to the video every time they click the ‘home’ link in the navigation menu.

    anyway, /#cs-content works fine for my site’s when the logo is inline with the navmenu, but not when the logo is on top of the navmenu (stacked) – what would the appropriate link be for a stacked layout? thanks

    #1124332
    armintz
    Participant
    This reply has been marked as private.
    #1124752
    Friech
    Moderator

    Hi There,

    Thanks for writing in! The home link on your menu works fine on my end. Would you mind providing us with a little more clarification on what it is you’re wanting to do. We’ll be happy to provide you with a response once we have a better understanding of the situation.

    Thanks.

    #1125737
    armintz
    Participant

    the home link currently takes you to the navmenu on the home page (see first screenshot), and not to the logo above the navmenu on the home page like it should (see second screenshot)

    #1126258
    Rad
    Moderator

    Hi there,

    You mean move the logo along with the navbar when it scrolls? If yes, please add this code to Admin > Appearance > Customizer > Custom > Javascript

    jQuery( '.x-logobar' ).prependTo('.x-navbar');

    Hope this helps.

    #1126653
    armintz
    Participant

    no, i don’t want to make the logo sticky.

    i want the home link in my navmenu to take the user to the portion of the header which displays my logo (see 2nd screenshot in my previous post)… this is just above the navbar.

    the home link currently send the user below the logo, directly to the navmenu (when i use /#cs-content as my home link)

    #1126866
    Rue Nel
    Moderator

    Hello There,

    Thank you for the clarifications! To resolve this issue, please add the following JS code in the customizer, Appearance > Customize > Custom > Javascript

    (function($){
      $('.x-brand').attr('id', 'top-page');
    })(jQuery);

    And then you must change the link from /#cs-content to #top-page instead.

    Hope this helps. Kindly let us know.

    #1127085
    armintz
    Participant

    unfortunately this did not work.

    #1127296
    Lely
    Moderator

    Hi There,

    Can you try updating the javascript code to this:

    (function($){
      $('.x-brand').attr('id', 'top-page');
      $('#menu-item-71 a').click(function(e){
    			    e.preventDefault();
    			    
    			    var hash = $(this).attr('href').split("#").slice(-1)[0];
    
    			    $('html,body').animate({
    			      scrollTop: $('#' + hash).offset().top)
    			    },700 ,'swing');
    			  });  
    })(jQuery);

    Do let us know how this goes.

    #1127541
    armintz
    Participant

    issue remains the same

    #1127935
    Rad
    Moderator

    Hi there,

    Please replace it with this one,

    (function($){
      $('.x-brand').attr('id', 'top-page');
      $('#menu-item-71 a').click(function(e){
    			    e.preventDefault();
    			    
    			    var hash = $(this).attr('href').split("#").slice(-1)[0];
    
    			    $('html,body').stop().animate({
    			      scrollTop: $('#' + hash).offset().top
    			    },700 ,'swing');
    			  });  
    })(jQuery);

    Hope this helps.

    #1127943
    armintz
    Participant

    issue is still the same.

    #1128350
    Rue Nel
    Moderator

    Hello There,

    Sorry if it didn’t work out! Could you please update the code and use this instead:

    (function($){
      $('.x-brand').attr('id', 'top-page');
      $('#menu-item-71 a').click(function(e){
        e.preventDefault();
        
        var hash = $(this).attr('href').split("#").slice(-1)[0];
        var position = $('#' + hash).offset().top - 40;
        
        $('html,body').stop().animate({
          scrollTop: position
        },700 ,'swing');
      });  
    })(jQuery);

    If this still do not work, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #1128644
    armintz
    Participant

    same issue.

    my url and login credentials were posted in the 2nd post of this thread.

    #1129237
    Rad
    Moderator

    Hi there,

    It’s not working because the two recent and recommended changes aren’t applied. I can still see the old code that is provided at #1127296. You can verify that by viewing your site’s source code through your browser (right click and hit “view source code”).

    The login on your second reply is for authentication for viewing your site. What we need is your WordPress admin login.

    Thanks!

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