Template:Team:DukeNB/CSS
From 2014.igem.org
(Difference between revisions)
Line 97: | Line 97: | ||
<div class="navleftholder"> | <div class="navleftholder"> | ||
<ul class="navleft"> | <ul class="navleft"> | ||
- | <li><a id="navleftsub1" class="navleftsub" href="# | + | <li><a id="navleftsub1" class="navleftsub" href="#apr">April</a></li> |
- | <li><a id="navleftsub2" class="navleftsub" href="# | + | <li><a id="navleftsub2" class="navleftsub" href="#mayjun">May/June</a></li> |
- | <li><a id="navleftsub3" class="navleftsub" href="# | + | <li><a id="navleftsub3" class="navleftsub" href="#jul">July</a></li> |
- | <li><a id="navleftsub4" class="navleftsub" href="# | + | <li><a id="navleftsub4" class="navleftsub" href="#aug">August</a></li> |
- | <li><a id="navleftsub5" class="navleftsub" href="# | + | <li><a id="navleftsub5" class="navleftsub" href="#sept">September</a></li> |
</ul></div> | </ul></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(function(){ | $(function(){ | ||
- | var | + | var apr_top = $("#apr").offset().top; |
- | var | + | var mayjun_top = $("#mayjun").offset().top; |
- | var | + | var jul_top = $("#jul").offset().top; |
- | var | + | var aug_top = $("#aug").offset().top; |
- | var | + | var sept_top = $("#sept").offset().top; |
//alert(tops); | //alert(tops); | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
var scroH = $(this).scrollTop(); | var scroH = $(this).scrollTop(); | ||
var screenH = window.innerHeight * 0.5; | var screenH = window.innerHeight * 0.5; | ||
- | if(scroH>= | + | if(scroH>=sept_top- screenH){ |
set_cur("#navleftsub5"); | set_cur("#navleftsub5"); | ||
- | }else if(scroH>= | + | }else if(scroH>=aug_top- screenH){ |
set_cur("#navleftsub4"); | set_cur("#navleftsub4"); | ||
- | }else if(scroH>= | + | }else if(scroH>=jul_top- screenH){ |
set_cur("#navleftsub3"); | set_cur("#navleftsub3"); | ||
- | }else if(scroH>= | + | }else if(scroH>=mayjun_top- screenH){ |
set_cur("#navleftsub2"); | set_cur("#navleftsub2"); | ||
- | }else if(scroH>= | + | }else if(scroH>=apr_top- screenH){ |
set_cur("#navleftsub1"); | set_cur("#navleftsub1"); | ||
} | } |
Revision as of 17:02, 6 October 2014