]> git.ipfire.org Git - ipfire.org.git/blobdiff - static/js/site.js
Bug 11327 try again to fix flickering on scroll
[ipfire.org.git] / static / js / site.js
index e4b31239fd2915ceab1612a71cfc0084525b02ce..4d6edddb560ea4b47a2515d122bda3b7bec9589d 100644 (file)
@@ -1,4 +1,10 @@
 $(document).ready(function () {
+       $("#scrollto").click(function(e) {
+               e.preventDefault();
+           $('body').animate({
+               scrollTop: $("#features").offset().top -72
+           }, 1500);
+       });
     $(window).scroll(function () {
         if ($(document).scrollTop() > 100) {
             $(".fixed-top").addClass("scrolled");
@@ -10,21 +16,6 @@ $(document).ready(function () {
     });
 });
 
-//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");
-       }
-});
-
-$("#scrollto").click(function() {
-    $('html, body').animate({
-        scrollTop: $("#features").offset().top - $('.fixed-top').height()
-    }, 1500, 'easeInOutExpo');
-});
-
 $.query = function(name){
        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
        return results[1] || 0;
@@ -37,15 +28,6 @@ $("a.download-splash").click(function(event) {
        window.location = "http://downloads.ipfire.org/download-splash?file="+linkLocation;
 });
 
-var $window = $(window);
-
-$(".sidenav").affix({
-       offset: {
-               top: function () { return $window.width() <= 980 ? 290 : 240 }
-               , bottom: 270
-       }
-});
-
 if (/.*download-splash.*/i.test(window.location.href)) {
        $("p.download-path").ready(function(){
                var valid = false;