griiettner
10/2/2013 - 7:10 PM

Bootstrap Smooth Scroll to Anchor

Bootstrap Smooth Scroll to Anchor

!function ($) {
	$(function(){
		$('#home, #me, #footer').carousel({});

		var $root = $('html, body');

		$('a').click(function() {
			var href = $.attr(this, 'href');
			$root.animate({
				scrollTop: $(href).offset().top
			}, 500, function () {
				window.location.hash = href;
			});
			return false;
		});
	})
}(window.jQuery)