summaryrefslogtreecommitdiff
path: root/js/smooth_scroll.js
diff options
context:
space:
mode:
authorprashant2015-06-30 11:09:24 +0530
committerprashant2015-06-30 11:09:24 +0530
commit575c131a16d2f29956fef1aff7d878f3d0645a83 (patch)
treef032f4f5a9b57b9b5e9d20ac732b925a663eac9c /js/smooth_scroll.js
downloadFOSSEE_Stats-575c131a16d2f29956fef1aff7d878f3d0645a83.tar.gz
FOSSEE_Stats-575c131a16d2f29956fef1aff7d878f3d0645a83.tar.bz2
FOSSEE_Stats-575c131a16d2f29956fef1aff7d878f3d0645a83.zip
Initial commit
Diffstat (limited to 'js/smooth_scroll.js')
-rwxr-xr-xjs/smooth_scroll.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/smooth_scroll.js b/js/smooth_scroll.js
new file mode 100755
index 0000000..d16dc1a
--- /dev/null
+++ b/js/smooth_scroll.js
@@ -0,0 +1,26 @@
+(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);