Team:DTU-Denmark/Templates/StartPage
From 2013.igem.org
(Difference between revisions)
Pdworzynski (Talk | contribs) |
|||
(3 intermediate revisions not shown) | |||
Line 28: | Line 28: | ||
<!-- Navigation scroll follow --> | <!-- Navigation scroll follow --> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $(window).scroll(function () { | + | var prevScrollPos = -1000; |
+ | $(window).scroll(function () { | ||
+ | |||
+ | <!-- here is added table of content fixing to screen : was all 35 with Title OutsideWhitebox--> | ||
+ | var scrollPos = Math.floor($(window).scrollTop()); | ||
- | + | if(Math.abs(prevScrollPos - scrollPos) <= 1){ | |
- | + | return "nuthin"; | |
+ | } | ||
+ | |||
var toc_margin_from_top = $(".navigation").height() + 35; | var toc_margin_from_top = $(".navigation").height() + 35; | ||
Line 54: | Line 60: | ||
if(scroll_pos_above_menubar){ | if(scroll_pos_above_menubar){ | ||
- | $(".navigation").offset({top: | + | $(".navigation").offset({top: 250 }); |
} else { | } else { | ||
$(".navigation").offset({top: scrollPos}); | $(".navigation").offset({top: scrollPos}); |
Latest revision as of 21:54, 4 October 2013