Template:Team:Cambridge/CAM 2012 TEMPLATE HEAD PROJECT1
From 2012.igem.org
(Difference between revisions)
Pdmallaband (Talk | contribs) (Created page with "<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="/Team:Cambridge/s...") |
Pdmallaband (Talk | contribs) |
||
Line 60: | Line 60: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | |||
+ | var top = $('#cam_left').offset().top - parseFloat($('#cam_left').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_left').addClass('fixed'); | ||
+ | } else { | ||
+ | // otherwise remove it | ||
+ | $('#cam_left').removeClass('fixed'); | ||
+ | } | ||
+ | }); | ||
$('.cam_grid_headover h6').css("display","none"); | $('.cam_grid_headover h6').css("display","none"); |
Revision as of 13:29, 20 September 2012