Team:Paris Bettencourt/header
From 2013.igem.org
(Difference between revisions)
Line 30: | Line 30: | ||
// listen for scroll | // listen for scroll | ||
var positionElementInPage = $('#menubarbleu').offset().top; | var positionElementInPage = $('#menubarbleu').offset().top; | ||
- | $(window).scroll( | + | $(window).scroll( |
- | + | $(function() { | |
- | + | if ($(window).scrollTop() >= positionElementInPage) { | |
- | + | // fixed | |
- | + | $('#menubarbleu').addClass("sticky"); | |
- | + | } else { | |
- | + | // relative | |
- | + | $('#menubarbleu').removeClass("sticky"); | |
- | + | } | |
- | + | }) | |
- | ); | + | ); |
</script> | </script> | ||
Revision as of 09:36, 30 July 2013
iGEM Paris Bettencourt 2013