Team:SDU-Denmark/core/header
From 2013.igem.org
(Difference between revisions)
Heidi.Wille (Talk | contribs) |
Heidi.Wille (Talk | contribs) |
||
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( | + | $(window).scroll(sticky_relocate); |
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</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