Template:Team:Cambridge/CAM 2012 TEMPLATE HEAD PROJECT
From 2012.igem.org
(Difference between revisions)
Pdmallaband (Talk | contribs) |
|||
Line 61: | Line 61: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | var top = $('#cam_top_logos').offset().top - parseFloat($('#cam_top_logos').css('marginTop').replace(/auto/, 0)); | ||
+ | $(window).scroll(function (event) { | ||
+ | // what the y position of the scroll is | ||
+ | var y = $(this).scrollTop(); | ||
+ | |||
+ | // whether that's below the form | ||
+ | if (y >= top) { | ||
+ | // if so, ad the fixed class | ||
+ | $('#cam_top_logos').addClass('fixed'); | ||
+ | } else { | ||
+ | // otherwise remove it | ||
+ | $('#cam_top_logos').removeClass('fixed'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
$('.cam_grid_headover h7').css("display","none"); | $('.cam_grid_headover h7').css("display","none"); | ||
Line 259: | Line 275: | ||
<div id='cam_right' class='cam-box1'> | <div id='cam_right' class='cam-box1'> | ||
+ | <div id = 'cam_top_logos_wrapper'> | ||
<div id = 'cam_top_logos' class = 'cam-topnav'> | <div id = 'cam_top_logos' class = 'cam-topnav'> | ||
+ | </div> | ||
</div> | </div> | ||
<div id='cam_pagecontent' class='cam-box-content'> | <div id='cam_pagecontent' class='cam-box-content'> | ||
</html> | </html> |
Revision as of 16:37, 25 September 2012