Team:SDU-Denmark/core/header
From 2013.igem.org
(Difference between revisions)
Heidi.Wille (Talk | contribs) |
Heidi.Wille (Talk | contribs) |
||
Line 11: | Line 11: | ||
$('#menubar').css("background", "transparent"); | $('#menubar').css("background", "transparent"); | ||
}); | }); | ||
- | + | $(window).scroll(function() { | |
+ | var fixadent = $("#top"), pos = fixadent.offset(); | ||
+ | if($(this).scrollTop() > (pos.top + 10) && fixadent.css('position') == 'static') { | ||
+ | fixadent.addClass('fixedtop'); | ||
+ | } | ||
+ | else if($(this).scrollTop() <= pos.top && fixadent.hasClass('fixedtop')) { | ||
+ | fixadent.removeClass('fixedtop'); | ||
+ | } | ||
+ | }) | ||
}) | }) | ||
</script> | </script> |
Revision as of 20:04, 4 August 2013