From 5d08913b298bd6d6e96941214d048e58f9dcf1b2 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Thu, 11 Dec 2014 20:22:03 +0100
Subject: [PATCH] animate automatic scrolls and don't scroll to border

This adds a subtle animation effect when scrolling to the #scroll__here
behaviour ID. It also adds a 100px offset to make the object not stick
to the browser border.
---
 lib/scripts/behaviour.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index 6b46add07..707f1c185 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -64,7 +64,9 @@ var dw_behaviour = {
     scrollToMarker: function(){
         var $obj = jQuery('#scroll__here');
         if($obj.length) {
-            $obj[0].scrollIntoView();
+            jQuery('html, body').animate({
+                scrollTop: $obj.offset().top - 100
+            }, 500);
         }
     },
 
-- 
GitLab