Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1066421
    auldreekie
    Participant

    I’ve added tabs to a page, but when a tab is clicked the whole page scrolls up and down. I’d like to prevent this from happening.

    I’ve tried all the custom Javascript solutions suggested by X Support in various other support topics, but nothing works.

    All relevant plugins are up to date.

    Can you help?

    #1066423
    auldreekie
    Participant
    This reply has been marked as private.
    #1067238
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery( function($) {
    $('.vc_tta-tab a').on('click', function( e ){
        setTimeout( function() { 
        $('html, body').stop().stop();
            console.log('scrolling stopped');
        }, 100 );
    });
    });

    strong>Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1068081
    auldreekie
    Participant

    That works perfectly.

    Thanks for the great support 🙂

    #1068166
    Rue Nel
    Moderator

    Hello There,

    Thanks for letting us know that it has been useful to you.
    Cheers.

    #1082033
    auldreekie
    Participant

    Quick follow up on this – tabbed content is still scrolling in tablet/mobile view.

    Is there a similar chunk of jquery to prevent this too?

    #1082582
    Rupok
    Member

    Hi there,

    You can try updating the code a bit :

    jQuery( function($) {
    $('.vc_tta-tab a').off('touchstart touchend').on('click', function( e ){
        setTimeout( function() { 
        $('html, body').stop().stop();
            console.log('scrolling stopped');
        }, 100 );
    });
    });

    Hope this helps.

    Cheers!

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