Skip Navigation

[Resolved] Remove tab animation

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the customer was having a scrolling animation after he had clicked the next tab on the Layouts tabbed cells.

Solution:

So this is an issue specific to the DIVI theme as Layouts does not do a scrolling animation when a tab is selected.

The issue comes from this line in the custom.js file in your theme. This file is located in your theme's directory in the js folder.

$( 'a[href*=#]:not([href=#])' ).click( function() {
            var $this_link = $( this ),
                disable_scroll = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ) || $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length;
 
            if ( ( location.pathname.replace( /^\//,'' ) == this.pathname.replace( /^\//,'' ) && location.hostname == this.hostname ) && ! disable_scroll ) {
                var target = $( this.hash );
                target = target.length ? target : $( '[name=' + this.hash.slice(1) +']' );
                if ( target.length ) {
 
                    et_pb_smooth_scroll( target, false, 800 );
 
                    if ( ! $( '#main-header' ).hasClass( 'et-fixed-header' ) && $( 'body' ).hasClass( 'et_fixed_nav' ) && $( window ).width() > 980 ) {
                        setTimeout(function(){
                            et_pb_smooth_scroll( target, false, 40, 'linear' );
                        }, 780 );
                    }
 
                    return false;
                }
            }
        });

Commenting out this section should resolve the issue.

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jeffrey Murnan 7 years ago.

Assisted by: Shane.

Author
Posts
#515424
page-example2.png
page-example1.png

I need help turning off the scrolling animation when clicking on a Layout Tab.

Site: this is a members only site (not publicly facing)

Expected Behavior:
No scroll animations happen when leveraging the Tab functionality within a Layout

Actual Behavior:
Scroll animations force the screen down so that the Tab is at the top of the page. It also lags for 2-3 seconds before the user can scroll up.

Screenshot 1: a look at the full page
Screenshot 2: scrolled down location where the page initially loads. This also happens when clicking on any of the other tabs

Help Needed:
Can you help me figure out how to remove the animation? Is this a CSS class or does it require more heavy duty modifications?

#515491

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeffery,

Thank you for contacting our support forum.

Could you provide me with a link to the page so I can have a look at the issue ?

Thanks,
Shane

#515494

Absolutely -- is there a way to private message you credentials since it is a closed corporate site?

#515545

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeffery,

The private fields have been enabled.

Thanks,
Shane

#516704

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeffery,

After doing some debugging i've come to the realisation that this effect is being caused by the theme.

The issue comes from this line in the custom.js file in your theme. This file is located in your theme's directory in the js folder.

$( 'a[href*=#]:not([href=#])' ).click( function() {
			var $this_link = $( this ),
				disable_scroll = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ) || $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length;

			if ( ( location.pathname.replace( /^\//,'' ) == this.pathname.replace( /^\//,'' ) && location.hostname == this.hostname ) && ! disable_scroll ) {
				var target = $( this.hash );
				target = target.length ? target : $( '[name=' + this.hash.slice(1) +']' );
				if ( target.length ) {

					et_pb_smooth_scroll( target, false, 800 );

					if ( ! $( '#main-header' ).hasClass( 'et-fixed-header' ) && $( 'body' ).hasClass( 'et_fixed_nav' ) && $( window ).width() > 980 ) {
						setTimeout(function(){
							et_pb_smooth_scroll( target, false, 40, 'linear' );
						}, 780 );
					}

					return false;
				}
			}
		});

Commenting out this section should resolve the issue.

Thanks,
Shane

#516775

Thank you, commenting out the code fixed my issue. In case anyone else runs into this problem, I am using the Divi theme and the tab animation that comes with it does not play nice with Toolset based tabs.

Really appreciate the help tracking this down!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.