]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/static/js/site.js
Make navigation bar white when scrolled down
[ipfire.org.git] / src / static / js / site.js
index 66a660dd73a6ec7d650a2dc57e89a215b2b6528e..95a150c7d5ac93cdd50d746e424a6253aae1ca67 100644 (file)
@@ -1,13 +1,9 @@
 $(document).ready(function () {        
-    $(window).scroll(function () {
-        if ($(document).scrollTop() > 100) {
-            $(".fixed-top").addClass("scrolled");
-            $(".menu-text").addClass("hidden");
-        } else {
-            $(".fixed-top").removeClass("scrolled");
-            $(".menu-text").removeClass("hidden");
-        }
-    });
+    $(document).scroll(function () {
+               var nav = $(".navbar");
+               nav.toggleClass("scrolled", $(this).scrollTop() >= 1);
+       });
+
     //* Menu *//
        $('.navbar-toggler-left').click(function() {
                $('#navbarSupportedContent, #mask').addClass('open');
@@ -80,4 +76,4 @@ jQuery.postJSON = function(url, args, callback) {
                        callback(eval("(" + response + ")"));
                }
        });
-};
\ No newline at end of file
+};