Local Links to Sections

4 replies · opened May 15, 2016

SSemicolon WebSTAFFMay 16, 2016

Hello,

For the Same Page Section Links on the Default.aspx, it is recommended that you use the data-scrollto="#section" Functionality on the **** Links. And for the Links from the Other Pages, please add the following JS code at the bottom of the Default.aspx Page just after the js/functions.js File Linking:


	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.

PPavelRomeroMay 16, 2016

Hi:

The problem is that i should use the same method for all pages, because my menu is in the MasterPage, i have not a code for Default.aspx and another pages. the code is the same.

Regards
Pavel

SSemicolon WebSTAFFMay 17, 2016

Hello,

Then you can use the above JS Code at the bottom of all the Pages just after the js/functions.js File Linking and it should definitely work fine.

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

PPavelRomeroMay 17, 2016

Hello:

Sorry to insist with this issue, but I think something I did not understand well, have placed the data-scrollTo to "Clientes" and "Empresas" have put the code after functions.js, but when I press "Clientes" or "Empresas"on the menu I get an error. Please your help.

Regards
Pavel

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