Team:Groningen/Template/SCRIPTS/events

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
$(document).ready(function () {
$(document).ready(function () {
-
//code2here
+
  var menuIconsHeight = $('.default .module.menu .item .icon').height();
 +
  $(window).scroll(function(){
 +
      if( $(window).scrollTop() > menuIconsHeight + 17) {
 +
        $('.module.menu .content').css({position: 'fixed', top: '-100pt'});
 +
        $('.module.menu .content').css({'left': 0 - $(document).scrollLeft() });
 +
      } else {
 +
        $('.module.menu .content').css({position: 'relative', top: '0', left:'0'});
 +
    }
 +
  })
 +
 
});
});
</html>
</html>

Revision as of 13:52, 17 October 2014

$(document).ready(function () { var menuIconsHeight = $('.default .module.menu .item .icon').height(); $(window).scroll(function(){ if( $(window).scrollTop() > menuIconsHeight + 17) { $('.module.menu .content').css({position: 'fixed', top: '-100pt'}); $('.module.menu .content').css({'left': 0 - $(document).scrollLeft() }); } else { $('.module.menu .content').css({position: 'relative', top: '0', left:'0'}); } }) });