diff --git a/Frontend/Index.html b/Frontend/Index.html index ba86c38..3bddecb 100755 --- a/Frontend/Index.html +++ b/Frontend/Index.html @@ -14,6 +14,7 @@ + @@ -22,6 +23,7 @@ + @@ -697,12 +699,15 @@ + + + - + diff --git a/Frontend/Javascript/OverlayScrollbar.js b/Frontend/Javascript/OverlayScrollbar.js new file mode 100644 index 0000000..edfa535 --- /dev/null +++ b/Frontend/Javascript/OverlayScrollbar.js @@ -0,0 +1,10 @@ +document.addEventListener("DOMContentLoaded", function() { + //The first argument are the elements to which the plugin shall be initialized + //The second argument has to be at least a empty object or a object with your desired options + OverlayScrollbars(document.querySelectorAll('body'), { }); +}); + +$(function() { + //The passed argument has to be at least a empty object or a object with your desired options + $('body').overlayScrollbars({ }); +}); \ No newline at end of file diff --git a/Frontend/Javascript/ScrollController.js b/Frontend/Javascript/ScrollController.js new file mode 100644 index 0000000..1f89603 --- /dev/null +++ b/Frontend/Javascript/ScrollController.js @@ -0,0 +1,21 @@ +/* When the user scrolls down, hide the navbar. When the user scrolls up, show the navbar */ +$(document).ready(function() { + var instance = $('body').overlayScrollbars(); + var prevScrollpos = instance.scroll().position.y; + + console.log(prevScrollpos); + + window.onscroll = function() { + + var currentScrollPos = instance.scroll().position.y; + console.log(currentScrollPos); + if (prevScrollpos > currentScrollPos) { + $("#header").css({"top" : "0"}); + } else { + $("#header").css({"top" : "-50px"}); + } + + prevScrollpos = currentScrollPos; + } + +}); \ No newline at end of file