Tag Archives: javascript

Scroll to an anchor

Smooth javascript scrolling.


<script type="text/javascript">// <![CDATA[
		function goToByScroll(id){
     			$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
		}

// ]]></script>

<a onclick=”goToByScroll(‘1’)” href=”javascript:void(0)”>Go to anchor 1</a>

<div id=”1″>content</div>