Team:UCLondon/Templates/Header
From 2012e.igem.org
(Difference between revisions)
Line 85: | Line 85: | ||
.MBWikiStyle .MBContent .editsection { font-size: 9px; font-family: Helvetica, sans-serif; } | .MBWikiStyle .MBContent .editsection { font-size: 9px; font-family: Helvetica, sans-serif; } | ||
.MBWikiStyle .MBContent p, .MBWikiStyle .MBContent li { color: rgb(117, 117, 117); font-family: Helvetica, sans-serif; font-size: 13px; } | .MBWikiStyle .MBContent p, .MBWikiStyle .MBContent li { color: rgb(117, 117, 117); font-family: Helvetica, sans-serif; font-size: 13px; } | ||
+ | |||
+ | |||
+ | .MBWikiStyle #toc.fixed { position:fixed; top:0; } | ||
</style> | </style> | ||
Line 93: | Line 96: | ||
var nHeight = $('.MBContent').height(); | var nHeight = $('.MBContent').height(); | ||
$('.MBWikiStyle').css('height', nHeight); | $('.MBWikiStyle').css('height', nHeight); | ||
+ | |||
+ | |||
+ | |||
+ | var top = $('#toc').offset().top - parseFloat($('#toc').css('marginTop').replace(/auto/,0)); | ||
+ | |||
+ | $(window).scroll(function (event) { | ||
+ | // let's do something funky | ||
+ | var y = $(this).scrollTop(); | ||
+ | |||
+ | // whether that's below the form | ||
+ | if (y >= top) { | ||
+ | // if so, ad the fixed class | ||
+ | $('#comment').addClass('fixed'); | ||
+ | } else { | ||
+ | // otherwise remove it | ||
+ | $('#comment').removeClass('fixed'); | ||
+ | } | ||
+ | }); | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 06:36, 16 September 2012