Team:SDU-Denmark/core/header

From 2013.igem.org

(Difference between revisions)
Line 4: Line 4:
<script type="text/javascript" src="https://2013.igem.org/Team:SDU-Denmark/core/jquery19?action=raw&ctype=text/javascript"></script>
<script type="text/javascript" src="https://2013.igem.org/Team:SDU-Denmark/core/jquery19?action=raw&ctype=text/javascript"></script>
<script type="text/javascript">
<script type="text/javascript">
 +
function sticky_relocate() {
 +
  var window_top = $(window).scrollTop();
 +
  var div_top = $('#sticky-anchor').offset().top;
 +
  if (window_top > div_top) {
 +
    $('.top').addClass('stick');
 +
  } else {
 +
    $('.top').removeClass('stick');
 +
  }
 +
}
     $(document).ready(function() {
     $(document).ready(function() {
         $('.left-menu').children().first().children().last().css('color', '');  
         $('.left-menu').children().first().children().last().css('color', '');  
Line 11: Line 20:
             $('#menubar').css("background", "transparent");   
             $('#menubar').css("background", "transparent");   
         });
         });
-
         $(window).scroll(function() {
+
         $(window).scroll(sticky_relocate);
-
          var fixadent = $(".top"), pos = fixadent.offset();
+
    });
-
          if($(this).scrollTop() > (pos.top + 10)) {
+
-
            if (fixadent.css('position') == 'static') {     
+
-
                fixadent.addClass('fixedtop');
+
-
            }
+
-
          }
+
-
          else if($(this).scrollTop() <= pos.top) {
+
-
            if (fixadent.hasClass('fixedtop')) {
+
-
                fixadent.removeClass('fixedtop');  
+
-
            }
+
-
          }
+
-
        });
+
-
    })
+
</script>
</script>
Line 31: Line 28:
<div class="BackgroundLayout">
<div class="BackgroundLayout">
     <div class="topWikiNavBackground"></div>
     <div class="topWikiNavBackground"></div>
 +
    <div id="sticky-anchor"></div>
     <div class="top">
     <div class="top">
              
              

Revision as of 06:54, 5 August 2013