Team:DTU-Denmark/Templates/StartPage
From 2013.igem.org
(Difference between revisions)
Pdworzynski (Talk | contribs) |
|||
(121 intermediate revisions not shown) | |||
Line 4: | Line 4: | ||
<!-- *********** --> | <!-- *********** --> | ||
- | |||
+ | <link rel="stylesheet" href="https://2013.igem.org/Team:DTU-Denmark/stylesheet?action=raw&ctype=text/css" type="text/css" /> | ||
+ | <link rel="icon" type="image/png" size="16x16" href="https://static.igem.org/mediawiki/2013/1/16/DTU-n2o-favicon.png"/> | ||
+ | |||
<!-- JAVASCRIPTS --> | <!-- JAVASCRIPTS --> | ||
Line 19: | Line 21: | ||
<script> | <script> | ||
$(function() { | $(function() { | ||
- | + | // initialize scrollable | |
- | + | $(".scrollable").scrollable().navigator(); | |
}); | }); | ||
</script> | </script> | ||
Line 26: | Line 28: | ||
<!-- Navigation scroll follow --> | <!-- Navigation scroll follow --> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $(window).scroll(function () { | + | var prevScrollPos = -1000; |
- | var scrollPos = $(window).scrollTop(); | + | $(window).scroll(function () { |
- | if (scrollPos | + | |
- | + | <!-- 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 scroll_pos_above_start_of_article = scrollPos < $(".whitebox.article").offset().top - 68; | ||
+ | var toc_end_reached_bottom_of_article = scrollPos + toc_margin_from_top + $(".toc").height() > $(".whitebox.article").offset().top + $(".whitebox.article").height() - 35; | ||
+ | var toc_margin_from_title = scrollPos < ($(".whitebox.article").offset().top ); | ||
+ | |||
+ | |||
+ | |||
+ | if(scroll_pos_above_start_of_article){ | ||
+ | $(".toc").offset({top: $(".whitebox.article").offset().top + 68}); | ||
+ | } else if(toc_end_reached_bottom_of_article){ | ||
+ | $(".toc").offset({top: $(".whitebox.article").offset().top + $(".whitebox.article").height() - $(".toc").height() - 35}); | ||
+ | } else if(toc_margin_from_title){ | ||
+ | $(".toc").offset({top: $(".whitebox.article").offset().top + 68}); | ||
} else { | } else { | ||
- | + | $(".toc").offset({top: scrollPos + toc_margin_from_top}); | |
} | } | ||
- | if ( | + | <!-- new attempt to fix menubar (jakob) --> |
- | + | ||
+ | var scroll_pos_above_menubar = scrollPos < 250; | ||
+ | |||
+ | if(scroll_pos_above_menubar){ | ||
+ | $(".navigation").offset({top: 250 }); | ||
} else { | } else { | ||
- | + | $(".navigation").offset({top: scrollPos}); | |
} | } | ||
+ | |||
+ | //if (scroll_pos_below_start_of_article){ //&& (scrollPos < $(document).height() - $(".navigation")[0].height() - 70)) { | ||
+ | // $(".toc").addClass("stickBelowNavigation"); | ||
+ | //} else { | ||
+ | // $(".toc").removeClass("stickBelowNavigation"); | ||
+ | //} | ||
}); | }); | ||
</script> | </script> | ||
Line 52: | Line 84: | ||
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> | <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> | ||
- | <!-- | + | <!-- Drop Down navigation --> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready( | $(document).ready( | ||
function(){ | function(){ | ||
- | $("ul.subnav").parent().find("> a").append("<span> | + | $("ul.subnav").parent().find("> a").append("<span> ▼</span>"); |
$("ul.topnav li").hover( | $("ul.topnav li").hover( | ||
function() { | function() { | ||
Line 90: | Line 122: | ||
</script> | </script> | ||
- | <!-- Remove "team" from the menubar | + | <!-- Remove "team" from the menubar --> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
Line 97: | Line 129: | ||
</script> | </script> | ||
- | <!-- Empty heading | + | <!-- If Empty heading -> Then remove it --> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
Line 110: | Line 142: | ||
<!-- Header image --> | <!-- Header image --> | ||
+ | |||
<div id="header"> | <div id="header"> | ||
<div class="centering"> | <div class="centering"> | ||
Line 116: | Line 149: | ||
<!-- Navigation bar --> | <!-- Navigation bar --> | ||
- | </html>{{:Team:DTU-Denmark/Templates/ | + | </html>{{:Team:DTU-Denmark/Templates/Navigationbar2}}<html> |
- | <!-- | + | |
- | <div id=" | + | <!-- Prepare for content --> |
+ | <div id="innercontent"> | ||
<div class="centering"> | <div class="centering"> | ||
- | <h1> | + | <div class="whitebox article"> |
+ | |||
+ | <div class="overviewPage"> | ||
+ | <h1> | ||
</html> | </html> | ||
{{{1}}} | {{{1}}} | ||
<html> | <html> | ||
- | + | </h1> | |
- | + | </div> | |
- | + | ||
- | |||
- | |||
- | |||
- | |||
</html> | </html> |
Latest revision as of 21:54, 4 October 2013