Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1129277
    armintz
    Participant

    @rad i’ve tried all codes in this thread, including the latest one. replying with login.

    #1129282
    armintz
    Participant
    This reply has been marked as private.
    #1129681
    Rue Nel
    Moderator

    Hello There,

    Thank you for providing the credentials. To save you from trouble, I went ahead and fixed the issue. I made some slight changes to the code and the final code is this:

    
    /* HOME LINK IN NAV MENU BELOW VIDEO */
    (function($){
    
      $('#menu-item-71 a').click(function(e){
        e.preventDefault();
        
        var mastheadHeight       = $('.masthead').outerHeight();
        var logobar							 = $('.x-logobar').outerHeight();
        var navbarFixedTopHeight = $('.x-navbar-fixed-top-active .x-navbar').outerHeight();
        var sliderAboveHeight    = $('.x-slider-container.above').outerHeight();
        var sliderBelowHeight    = $('.x-slider-container.below').outerHeight();
        var heightSum            = mastheadHeight + sliderAboveHeight + sliderBelowHeight  - ( navbarFixedTopHeight + logobar );
        
        console.log(heightSum);
        
        $('html,body').stop().animate({
          scrollTop: heightSum
        },700 ,'easeInOutExpo');
      });  
    })(jQuery);

    Upon clicking on the home menu item, it will display the logo bar. If you need anything else we can help you with, don’t hesitate to open another thread.

    Best Regards.

    #1129882
    armintz
    Participant

    it only works on the home page.

    #1130229
    Rad
    Moderator

    Hi there,

    Instead of adding just #top-page as link, I changed it to full URL http://bp24.wpengine.com/#top-page

    And I changed the code to this,

    /* HOME LINK IN NAV MENU BELOW VIDEO */
    (function($){
    
    function scrollToLogo() {
    
        var mastheadHeight       = $('.masthead').outerHeight();
        var logobar              = $('.x-logobar').outerHeight();
        var navbarFixedTopHeight = $('.x-navbar-fixed-top-active .x-navbar').outerHeight();
        var sliderAboveHeight    = $('.x-slider-container.above').outerHeight();
        var sliderBelowHeight    = $('.x-slider-container.below').outerHeight();
        var heightSum            = mastheadHeight + sliderAboveHeight + sliderBelowHeight  - ( navbarFixedTopHeight + logobar );
        
        console.log(heightSum);
        
        $('html,body').stop().animate({
          scrollTop: heightSum
        },700 ,'easeInOutExpo');
    
    }
    
      $('.home #menu-item-71 a').click(function(e){
        
        e.preventDefault();
        
        scrollToLogo();
    
      });
      
      if ( window.location.hash =='#top-page' ) {
        
        $(document).ready( scrollToLogo );
    
      }
      
    
    })(jQuery);

    That should do it 🙂 Cheers!

    #1130954
    armintz
    Participant

    thanks, that did it.

    #1131104
    Rad
    Moderator

    You’re welcome!

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