Template:Freiburg2013 Template1

From 2013.igem.org

(Difference between revisions)
m
Line 399: Line 399:
</style>
</style>
 +
 +
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
 +
<script>
 +
$(function () {
 +
 
 +
  var msie6 = $.browser == 'msie' && $.browser.version < 7;
 +
 
 +
  if (!msie6) {
 +
    var top = $('#sidebar_content').offset().top - parseFloat($('#sidebar_content').css('margin-top').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
 +
        $('#sidebar_content').addClass('fixed');
 +
      } else {
 +
        // otherwise remove it
 +
        $('#sidebar_content').removeClass('fixed');
 +
      }
 +
    });
 +
  } 
 +
});
 +
</script>
 +
 +
<script>
<script>

Revision as of 12:48, 12 September 2013