]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blobdiff - static/js/site.js
add stats
[people/shoehn/ipfire.org.git] / static / js / site.js
index a4ca8c449a8543fa5b146ce338bd0cf022b39c80..e4b31239fd2915ceab1612a71cfc0084525b02ce 100644 (file)
@@ -1,3 +1,15 @@
+$(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");
+        }
+    });
+});
+
 //jQuery to collapse the navbar on scroll
 $(window).scroll(function() {
        if ($(".navbar").offset().top > 50) {
@@ -7,15 +19,10 @@ $(window).scroll(function() {
        }
 });
 
-//jQuery for page scrolling feature - requires jQuery Easing plugin
-$(function() {
-       $('.page-scroll a, a.page-scroll').bind('click', function(event) {
-               var $anchor = $(this);
-               $('html, body').stop().animate({
-                       scrollTop: $($anchor.attr('href')).offset().top
-               }, 1500, 'easeInOutExpo');
-               event.preventDefault();
-       });
+$("#scrollto").click(function() {
+    $('html, body').animate({
+        scrollTop: $("#features").offset().top - $('.fixed-top').height()
+    }, 1500, 'easeInOutExpo');
 });
 
 $.query = function(name){
@@ -88,4 +95,4 @@ jQuery.postJSON = function(url, args, callback) {
                        callback(eval("(" + response + ")"));
                }
        });
-};
+};
\ No newline at end of file