Team:Paris Bettencourt/header

From 2012.igem.org

(Difference between revisions)
Line 39: Line 39:
</script>
</script>
-
<script type="text/javascript">
+
 
-
// listen for scroll
+
-
var positionElementInPage = $('#menu').offset().top;
+
-
$(window).scroll(
+
-
    $(function() {
+
-
        if ($(window).scrollTop() >= positionElementInPage) {
+
-
            // fixed
+
-
            $('#menu').addClass("sticky");
+
-
        } else {
+
-
            // relative
+
-
            $('#menu').removeClass("sticky");
+
-
        }
+
-
    })
+
-
);
+
-
</script>
+
</head>
</head>
Line 119: Line 105:
<!--</div>-->
<!--</div>-->
<!--</body>-->
<!--</body>-->
 +
<script type="text/javascript">
 +
// listen for scroll
 +
var positionElementInPage = $('#menu').offset().top;
 +
$(window).scroll(
 +
    $(function() {
 +
        if ($(window).scrollTop() >= positionElementInPage) {
 +
            // fixed
 +
            $('#menu').addClass("sticky");
 +
        } else {
 +
            // relative
 +
            $('#menu').removeClass("sticky");
 +
        }
 +
    })
 +
);
 +
</script>
</html>
</html>

Revision as of 14:40, 23 August 2012


iGEM Paris Bettencourt 2012