Tagged: x
-
AuthorPosts
-
August 12, 2016 at 5:24 pm #1129277
armintzParticipant@rad i’ve tried all codes in this thread, including the latest one. replying with login.
August 12, 2016 at 5:25 pm #1129282
armintzParticipantThis reply has been marked as private.August 13, 2016 at 1:48 am #1129681
Rue NelModeratorHello 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.
August 13, 2016 at 8:33 am #1129882
armintzParticipantit only works on the home page.
August 13, 2016 at 7:09 pm #1130229
RadModeratorHi 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!
August 14, 2016 at 2:05 pm #1130954
armintzParticipantthanks, that did it.
August 14, 2016 at 7:10 pm #1131104
RadModeratorYou’re welcome!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1124330 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
