Team:TU-Eindhoven/Templates/header
From 2012.igem.org
(Difference between revisions)
(One intermediate revision not shown) | |||
Line 166: | Line 166: | ||
}); | }); | ||
$('a.image').lightBox(); | $('a.image').lightBox(); | ||
+ | |||
+ | var top = $('#accmenu').offset().top - parseFloat($('#accmenu').css('margin-top').replace(/auto/, 0)); | ||
+ | |||
+ | $(window).scroll(function () { | ||
+ | // what the y position of the scroll is | ||
+ | var y = $(window).scrollTop(); | ||
+ | |||
+ | // whether that's below the form | ||
+ | if(y >= top) { | ||
+ | // if so, add the fixed class | ||
+ | $('#accmenu').addClass('fixed'); | ||
+ | } else { | ||
+ | // otherwise, remove it | ||
+ | $('#accmenu').removeClass('fixed'); | ||
+ | } | ||
+ | }); | ||
+ | |||
}); | }); | ||
</script> | </script> |
Latest revision as of 10:42, 25 September 2012