[tor-commits] [metrics-web/master] Fix scroll-to-top button.

karsten at torproject.org karsten at torproject.org
Mon Jan 9 17:03:42 UTC 2017


commit 0c8a2f649333edf52c9075745e862d65751994d8
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Thu Jan 5 13:43:58 2017 +0100

    Fix scroll-to-top button.
---
 website/web/js/script.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/website/web/js/script.js b/website/web/js/script.js
index 10a918a..5efcf10 100644
--- a/website/web/js/script.js
+++ b/website/web/js/script.js
@@ -25,9 +25,7 @@ jQuery(function() {
     var target = this.hash;
     var $target = $(target.split('#').join('#anchor-'));
     if ($target.offset() != null) {
-      $('html, body').stop().animate({
-        'scrollTop': ($target.offset().top + $(document).scrollTop())
-      }, 900, 'swing', function () {
+      jQuery('html,body').animate({scrollTop: $target.offset().top},900, function(){
         window.location.hash = target;
       });
     }





More information about the tor-commits mailing list