Disable tab auto scroll on desktop.

3 replies · opened Apr 22, 2017

DdaihloApr 22, 2017

I like the new tab-scroll function on the medical template, but would only like to show it on mobile.
Is this possible?
Thanks :)

SSemicolon WebSTAFFApr 23, 2017

Hello,

Please find the following code in the js/functions.js File:

$(this).toggleClass('acctitlec').next().slideDown("normal", function(){
	$('html,body').stop(true).animate({
		'scrollTop': clickTarget.offset().top - ( SEMICOLON.initialize.topScrollOffset() - 40 )
	}, 800, 'easeOutQuad' );
});

and replace it with:

if( $body.hasClass('device-xs') || $body.hasClass('device-xxs') ) {
	$(this).toggleClass('acctitlec').next().slideDown("normal", function(){
		$('html,body').stop(true).animate({
			'scrollTop': clickTarget.offset().top - ( SEMICOLON.initialize.topScrollOffset() - 40 )
		}, 800, 'easeOutQuad' );
	});
}

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

DdaihloApr 24, 2017

Thanks for the answer :)

This change stops the accordian working altogether on desktop but does allow the scrolling to take place on mobile.

Could you take another look?

Thanks :)

SSemicolon WebSTAFFApr 26, 2017

Hello,

Oops! We Really Apologize, we made a Slight Error with the Code we provided you! Please use the following code:

$(this).toggleClass('acctitlec').next().slideDown("normal", function(){
	if( $body.hasClass('device-xs') || $body.hasClass('device-xxs') ) {
		$('html,body').stop(true).animate({
			'scrollTop': clickTarget.offset().top - ( SEMICOLON.initialize.topScrollOffset() - 40 )
		}, 800, 'easeOutQuad' );
	}
});

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard