Automatic scroll down

Hi guys!

After several remarks from people not knowing what to do :roll_eyes: once arrived on our legal notice page, we are looking for a pinch of code aiming at automatically scroll down to the next section, ±8 seconds after loading and without having to click any button or moving the mouse.

With thanks in advance,

Victor

Hi Victor,

Thank you for reaching out to us. This would require custom scripting and regretfully custom development is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it.

With that being said I can point you in a right direction so you can get started. First give your section a class e.g auto-scroll where you want the page to scroll to automatically and then paste the following code in Cornerstone’s JS section:

jQuery(document).ready(function($) {
	setTimeout(function(){ 
		$('html, body').animate({
			scrollTop: $('.auto-scroll').offset().top
		}, 850, 'xEaseInOutExpo');
	}, 8000);
});

8000 in the above code is 8 seconds, so the script will execute after 8 seconds automatically.

Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Thank you for your understanding.

1 Like

Hi @Nabeel and many thanks for this very appreciated solution! :trophy: :blush:

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.