psullivan6
3/20/2013 - 6:51 PM

Takes a link to an anchor tag and scrolls the page to that element. The script uses an offset and assumed value of 50, but replace this with

Takes a link to an anchor tag and scrolls the page to that element. The script uses an offset and assumed value of 50, but replace this with the space needed to make the anchor tag element appear correctly on the page

<a class="scroll" target="_self" href="http://main-site-here.com/#about">About</a>
	
<script>
	
	$('.scroll').on("click", function () {
			
		var e = $(this).prop('hash');
		
		return $("html,body").animate({ scrollTop: $(e).offset().top }, 600), !1;
		
	});
	
</script>