Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #341805

    Iaink
    Participant

    Good afternoon,

    We are using a href to put link tabs to other tabs. It works correctly, save for one niggle. Instead of scrolling to the very top of the tabs container, it scrolls in line with the tab heading, meaning that visitors to the site have to scroll up manually in order to read the text in its entirety. Is it possible to make it scroll to the top of the tabs box?

    Many thanks. Love the theme, by the way!

    #341809

    Iaink
    Participant
    This reply has been marked as private.
    #341824

    Christopher
    Moderator

    Hi there,

    Please add the following code in Customize -> Custom -> JavaScript :

    jQuery( function($) {
    
    $(document).on('click', '.x-accordion-toggle, .x-nav-tabs .x-nav-tabs-item a', function( e ){
    $('html, body').stop();
    });
    
    });

    Hope it helps.

    #341846

    Iaink
    Participant

    Hi there,

    Thanks for the prompt reply. Unfortunately, the issue persists, as the JS only affects when the tabs themselves are clicked.

    What we’re looking for is for the page to scroll up to the top of the tabs container when the links housed within the tab’s text area are clicked (“Click here to start”, “Next: Financial Planning etc.”).

    Many thanks!

    #341931

    Zeshan
    Member

    Hi there,

    Thanks for writing in! That could technically be possible with custom development. While that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

    So, you can try using this JS code instead under Custom > JavaScript in the Customizer:

    jQuery(document).ready(function($) {
      $('.enable_jump_to').on('click touchstart', function(e) {
        e.preventDefault();
        var el                    = $(this).closest('.x-tab-content').prev('.x-nav');
        var adminbarHeight        = $('#wpadminbar').outerHeight();
        var navbarFixedTopHeight  = $('.x-navbar-fixed-top-active .x-navbar').outerHeight();
    
        $('html, body').animate({
          scrollTop: el.offset().top - $('.x-navbar-fixed-top-active .x-navbar').outerHeight() - $('#wpadminbar').outerHeight() - 10
        }, 500);
      });
    });

    Thanks!

    #342299

    Iaink
    Participant

    Hi there,

    That’s perfect, does the job magnificently. Top notch support. Many thanks!

    #342485

    Lely
    Moderator

    You’re welcome.

    Cheers!
    X