Team:UniSalento Lecce/js/fixed-sidebar.js

From 2013.igem.org

(Difference between revisions)
(Created page with "$(window).scroll(function() { if ($(this).scrollTop() > 230) { $("nav").css({ "position": "fixed", "top": 0 }); } else { $("nav").css({ "position": "...")
 
Line 1: Line 1:
$(window).scroll(function() {
$(window).scroll(function() {
-
     if ($(this).scrollTop() > 230) {
+
     if ($(this).scrollTop() > 290) {
-
         $("nav").css({ "position": "fixed", "top": 0 });
+
         $(".fixsidebar").css({ "position": "fixed", "top": "90px" });
     }  
     }  
     else {
     else {
-
         $("nav").css({ "position": "absolute", "top": "230px" });
+
         $(".fixsidebar").css({ "position": "absolute", "top": "365px" });
-
     }  
+
     }  
});
});

Latest revision as of 14:00, 30 September 2013

$(window).scroll(function() {

   if ($(this).scrollTop() > 290) {
       $(".fixsidebar").css({ "position": "fixed", "top": "90px" });
   } 
   else {
       $(".fixsidebar").css({ "position": "absolute", "top": "365px" });
   }   	

});