Team:UniSalento Lecce/js/fixed-navbar.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() > 230) { | ||
- | $(" | + | $("nav").css({ "position": "fixed", "top": 0 }); |
} | } | ||
else { | else { | ||
- | $(" | + | $("nav").css({ "position": "absolute", "top": "230px" }); |
} | } | ||
}); | }); |
Latest revision as of 09:59, 5 August 2013
$(window).scroll(function() {
if ($(this).scrollTop() > 230) { $("nav").css({ "position": "fixed", "top": 0 }); } else { $("nav").css({ "position": "absolute", "top": "230px" }); }
});