Team:Grenoble-EMSE-LSU/Templates/Team
From 2013.igem.org
(Difference between revisions)
Line 29: | Line 29: | ||
</div> | </div> | ||
</div> | </div> | ||
+ | |||
+ | |||
+ | <!-- Script --> | ||
+ | |||
+ | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | |||
+ | $(document).ready(function () { | ||
+ | var top = $('#scroll').offset().top - parseFloat($('#scroll').css('marginTop').replace(/auto/, 0)); | ||
+ | $(window).scroll(function (event) { | ||
+ | var y = $(this).scrollTop(); | ||
+ | if (y >= top) { | ||
+ | $('#scroll').addClass('fixed'); | ||
+ | } else { | ||
+ | $('#scroll').removeClass('fixed'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
</html> | </html> |
Revision as of 14:20, 20 August 2013