Team:DTU-Denmark/Templates/StartPage

From 2013.igem.org

(Difference between revisions)
 
(30 intermediate revisions not shown)
Line 21: Line 21:
     <script>
     <script>
         $(function() {
         $(function() {
-
    // initialize scrollable
+
        // initialize scrollable
-
    $(".scrollable").scrollable().navigator();
+
        $(".scrollable").scrollable().navigator();
         });
         });
     </script>
     </script>
Line 28: 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 > 240) { <!-- was 110 -jakob, we need to remeasure the heigth of our top banner -->
+
           
-
                $(".navigation").addClass("stickToTop");
+
            <!-- here is added table of content fixing to screen : was all 35 with Title OutsideWhitebox-->
-
            } else {
+
             var scrollPos = Math.floor($(window).scrollTop());
-
                $(".navigation").removeClass("stickToTop");
+
 
 +
             if(Math.abs(prevScrollPos - scrollPos) <= 1){
 +
                  return "nuthin";
             }
             }
-
<!-- here is added table of content fixing to screen : was all 35 with Title OutsideWhitebox-->
+
 
             var toc_margin_from_top = $(".navigation").height() + 35;
             var toc_margin_from_top = $(".navigation").height() + 35;
Line 41: Line 43:
             var toc_end_reached_bottom_of_article = scrollPos + toc_margin_from_top + $(".toc").height() > $(".whitebox.article").offset().top + $(".whitebox.article").height() - 35;
             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 );
             var toc_margin_from_title = scrollPos < ($(".whitebox.article").offset().top );
 +
           
 +
             if(scroll_pos_above_start_of_article){
             if(scroll_pos_above_start_of_article){
Line 51: Line 55:
                   $(".toc").offset({top: scrollPos + toc_margin_from_top});
                   $(".toc").offset({top: scrollPos + toc_margin_from_top});
             }
             }
 +
<!-- new attempt to fix menubar (jakob) -->
 +
            var scroll_pos_above_menubar = scrollPos < 250;
 +
 +
            if(scroll_pos_above_menubar){
 +
                  $(".navigation").offset({top: 250 });
 +
            } else {
 +
                  $(".navigation").offset({top: scrollPos});
 +
            }
             //if (scroll_pos_below_start_of_article){ //&& (scrollPos < $(document).height() - $(".navigation")[0].height() - 70)) {
             //if (scroll_pos_below_start_of_article){ //&& (scrollPos < $(document).height() - $(".navigation")[0].height() - 70)) {
Line 130: Line 142:
     <!-- Header image -->
     <!-- Header image -->
 +
     <div id="header">
     <div id="header">
         <div class="centering">
         <div class="centering">

Latest revision as of 21:54, 4 October 2013