X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b14222dabd7e8242e5e066af0a6691fbe48ef516..refs/pull/360/head:/resources/assets/js/global.js diff --git a/resources/assets/js/global.js b/resources/assets/js/global.js index 94462ed64..650919f85 100644 --- a/resources/assets/js/global.js +++ b/resources/assets/js/global.js @@ -61,10 +61,9 @@ Controllers(ngApp, window.Events); // Smooth scrolling jQuery.fn.smoothScrollTo = function () { if (this.length === 0) return; - let scrollElem = document.documentElement.scrollTop === 0 ? document.body : document.documentElement; - $(scrollElem).animate({ + $('html, body').animate({ scrollTop: this.offset().top - 60 // Adjust to change final scroll position top margin - }, 800); // Adjust to change animations speed (ms) + }, 300); // Adjust to change animations speed (ms) return this; };