ScrollTo Anchor link - external page link

5 replies · opened May 14, 2018

Aagent8designMay 14, 2018

Hi,

I've been trying to anchor linking to an external page to work from my index.html to about.html with an offset to prevent the sticky header covering the content. I found the support tickets referencing this but can't get it to work:

http://support.semicolonweb.com/forums/topic/anchor-links-not-working/

Can you point me in the right direction?

I'll post a private comment with the URL of the test site separately.

Thanks,
Nick.

Aagent8designMay 17, 2018

Hi,

Can you please help me with this issue?

Thanks,
Nick.

Aagent8designMay 30, 2018

HELLO?!?!?!?

SSemicolon WebSTAFFJun 19, 2018

Hello,

We Really Apologize about the Delays and Thank You so much for your Patience!

The code you are using is incorrect. Please make sure that the Basic HTML rules are followed. Please find the following code on the Page:


jQuery(document).ready( function(){
	setTimeout(function() {
		if (location.hash) {
			window.scrollTo(0, 0);
		}
	}, 1);
});

jQuery(window).on('load', function(){
	var divScrollToAnchor = window.location.hash;

	if( typeof divScrollToAnchor !== 'undefined' ) {
		var t = setTimeout( function(){
			$('html,body').stop(true).animate({
				'scrollTop': $( divScrollToAnchor ).offset().top - 100
			}, 700, 'easeOutQuad');
		}, 1000);
	}
});

and replace it with:


	jQuery(document).ready( function(){
		setTimeout(function() {
			if (location.hash) {
				window.scrollTo(0, 0);
			}
		}, 1);
	});

	jQuery(window).on('load', function(){
		var divScrollToAnchor = window.location.hash;

		if( typeof divScrollToAnchor !== 'undefined' ) {
			var t = setTimeout( function(){
				$('html,body').stop(true).animate({
					'scrollTop': $( divScrollToAnchor ).offset().top - 100
				}, 700, 'easeOutQuad');
			}, 1000);
		}
	});

This will definitely fix the issue. Additionally, also make sure that the Basic HTML Structure of Canvas is followed according to the Default Templates. Please follow the Documentation > Start > HTML Structure Section.

Hope this Helps!

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

Aagent8designJun 25, 2018

Great. Thank you that worked.

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