The animate doesn't work, can you tell me what I'm doing wrong?
<a id="pediatric-primary-health-care" href="#" class="anchor"> </a>
<script>
jQuery(document).ready(function() {
function scrollToAnchor(aid){
var aTag = jQuery("a[name='"+ aid +"']");
jQuery('html,body').animate({
scrollTop: aTag.offset().top
}, 'slow');
}
jQuery("a").click(function() {
var href = jQuery(this).attr('href').replace('#', '')
scrollToAnchor(href);
});
});
</script>