jQuery(document).ready(function() { // Scrollto jQuery(function() { jQuery('.scroll-link').bind('click.scroll-link', function(e) { e.preventDefault(); var target = this.hash, $target = jQuery(target); if ($target.offset()) { jQuery('html, body').stop().animate({ 'scrollTop': $target.offset().top - 0 }, 1500, 'swing', function() { window.location.hash = target; }); } else { window.location = this.href; } }); }); });