Team:TU Eindhoven/Notebook/stickyheader
From 2014.igem.org
$(function(){
// Check the initial Poistion of the Sticky Header var stickyHeaderTop = $('#menu').offset().top; $(window).scroll(function(){ if( $(window).scrollTop() > stickyHeaderTop ) { $('#stickyheader').css({position: 'fixed', top: '0px'}); $('#random').css('display', 'block'); } else { $('#stickyheader').css({position: 'static', top: '0px'}); $('#random').css('display', 'none'); } }); });