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