Skip to content
Snippets Groups Projects
Commit 5d08913b authored by Andreas Gohr's avatar Andreas Gohr
Browse files

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.
parent f7dbf175
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment