Team:Grenoble/script
From 2011.igem.org
(Difference between revisions)
Maxime.huet (Talk | contribs) |
Maxime.huet (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | <html> | ||
+ | |||
<!-- Remove all empty <p> tags --> | <!-- Remove all empty <p> tags --> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 9: | Line 11: | ||
<!-- jQuery Tools (slider) --> | <!-- jQuery Tools (slider) --> | ||
- | + | <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script> | |
- | + | <script> | |
- | + | $(function() { | |
- | + | // initialize scrollable | |
- | + | $(".scrollable").scrollable().navigator(); | |
- | + | }); | |
- | + | </script> | |
- | + | <!-- Navigation scroll follow --> | |
- | + | <script type="text/javascript"> | |
- | + | $(window).scroll(function () { | |
- | + | var scrollPos = $(window).scrollTop(); | |
- | + | if (scrollPos > 110) { | |
- | + | $(".navigation").addClass("stickToTop"); | |
- | + | } else { | |
- | + | $(".navigation").removeClass("stickToTop"); | |
- | + | } | |
- | + | if (scrollPos > 180) { | |
- | + | $(".toc").addClass("stickBelowNavigation"); | |
- | + | } else { | |
- | + | $(".toc").removeClass("stickBelowNavigation"); | |
- | + | } | |
- | + | }); | |
- | + | </script> | |
Line 65: | Line 67: | ||
); | ); | ||
</script> | </script> | ||
+ | |||
+ | </html> |
Revision as of 20:21, 21 October 2011