Team:Grenoble-EMSE-LSU/Templates/Project
From 2013.igem.org
(Difference between revisions)
Line 42: | Line 42: | ||
</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:19, 20 August 2013