Team:Grenoble-EMSE-LSU/Templates/Home
From 2013.igem.org
(Difference between revisions)
Line 37: | Line 37: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
- | var top = $('# | + | var top = $('#scroll').offset().top - parseFloat($('#scroll').css('marginTop').replace(/auto/, 0)); |
$(window).scroll(function (event) { | $(window).scroll(function (event) { | ||
var y = $(this).scrollTop(); | var y = $(this).scrollTop(); | ||
if (y >= top) { | if (y >= top) { | ||
- | $('# | + | $('#scroll').addClass('fixed'); |
} else { | } else { | ||
- | $('# | + | $('#scroll').removeClass('fixed'); |
} | } | ||
}); | }); |
Revision as of 14:11, 20 August 2013