summaryrefslogtreecommitdiff
path: root/js/smooth_scroll.js
blob: 10e914517b8288b6bad8b50e641d608e3f1a68e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(function($) {
	$(document).ready(function() {
		$('a[href*=#]:not([href=#])').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
				|| location.hostname == this.hostname) {
				var target = $(this.hash);
				target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
					if (target.length) {
						$('html,body').animate({
							scrollTop: target.offset().top
						}, 1000);
						return false;
					}
				}
		});
	$(".quick").click(function() {
		$(".quick").removeClass("badge-success");
		$(this).addClass("badge-success");
		setTimeout(function() {
			$(".quick").removeClass("badge-success");
		}, 4000);
	});
	//$('.quick').tooltip();
	});
})(jQuery);