Links to sections result "too high"

1 reply · opened Jun 1, 2016

AarahsoJun 1, 2016

I am having a problem similar to http://support.semicolonweb.com/forums/topic/local-links-to-sections/ but couldn't resolve it with the method proposed.

When clicking a link to a section in the header navigation (example Travel lodging) the resulting is "too high" with the top of the section cut off at the top.
However, the link to the section in the green-blue submenu (which is on all pages except index) goes to the correct location on the page.

The website: http://www.math.vt.edu/people/gugercin/householder/index.html

Thank you so much!

SSemicolon WebSTAFFJun 3, 2016

Hello,

Please add the following JS code at the bottom of the travel.html Page just after the js/functions.js File:


	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 should definitely work fine. 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