Template:Freiburg2013 Template1
From 2013.igem.org
(Difference between revisions)
m |
m |
||
Line 404: | Line 404: | ||
<script> | <script> | ||
- | $(document). | + | var fixed = false; |
- | $('#sidebar_content'). | + | |
+ | $(document).scroll(function() { | ||
+ | if( $(this).scrollTop() >= 100 ) { | ||
+ | if( !fixed ) { | ||
+ | fixed = true; | ||
+ | $('#sidebar_content').css({position:'fixed',top:20}); // Or set top:20px; in CSS | ||
+ | } // It won't matter when static | ||
+ | } else { | ||
+ | if( fixed ) { | ||
+ | fixed = false; | ||
+ | $('#sidebar_content').css({position:'static'}); | ||
+ | } | ||
+ | } | ||
}); | }); | ||
</script> | </script> |
Revision as of 13:44, 12 September 2013