]> git.ipfire.org Git - ipfire.org.git/blobdiff - static/js/site.js
Massive web site update
[ipfire.org.git] / static / js / site.js
index 83c3bb30ed2104f926437d66698750f0174d68a5..a4ca8c449a8543fa5b146ce338bd0cf022b39c80 100644 (file)
@@ -1,3 +1,23 @@
+//jQuery to collapse the navbar on scroll
+$(window).scroll(function() {
+       if ($(".navbar").offset().top > 50) {
+               $(".navbar-fixed-top").addClass("top-nav-collapse");
+       } else {
+               $(".navbar-fixed-top").removeClass("top-nav-collapse");
+       }
+});
+
+//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();
+       });
+});
+
 $.query = function(name){
        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
        return results[1] || 0;
@@ -14,7 +34,7 @@ var $window = $(window);
 
 $(".sidenav").affix({
        offset: {
-               top: function () { return $window.width() <= 980 ? 290 : 210 }
+               top: function () { return $window.width() <= 980 ? 290 : 240 }
                , bottom: 270
        }
 });
@@ -46,7 +66,7 @@ if (/.*download-splash.*/i.test(window.location.href)) {
        });
 }
 
-$(".planet-search-autocomplete").typeahead({
+/* $(".planet-search-autocomplete").typeahead({
        source: function(query, process) {
                $.get("/api/planet/search/autocomplete", { q: query }, function(data) {
                        if (data.query == query) {
@@ -54,8 +74,7 @@ $(".planet-search-autocomplete").typeahead({
                        }
                });
        },
-});
-
+}); */
 
 function getCookie(name) {
        var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");