freddielore
8/21/2015 - 2:52 AM

Scroll to specific ID. Must be added in the footer area.

Scroll to specific ID. Must be added in the footer area.

<script type="text/javascript">
	jQuery(document).ready(function($){

		var scroll_delay = 4000;
		var top = 230;
		
		var app = {
			init: function(){
				var sel = window.location.hash;
				// only autoscroll if ID is detected in the URL
				if( sel != "" ){ 
					app.scrollView(sel);
				}
			},
			scrollView: function (el) {
			      $('html, body').animate({
			          scrollTop: $(el).offset().top - top
			      }, 500);
			}
		}

		setTimeout(function(){
			app.init();
		}, scroll_delay);
	});
</script>