Difference between revisions of "Team:Uppsala/test5"

 
(27 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
{{Uppsala/javascript/scroll-button}}
 
{{Uppsala/javascript/scroll-button}}
 
{{Uppsala/javascript/redirect_js}}
 
{{Uppsala/javascript/redirect_js}}
{{Uppsala/sideNav}}
+
 
  
  
Line 23: Line 23:
  
  
 
+
/*
 
.content-text{
 
.content-text{
 
     margin-right: calc(50vw + 200px);
 
     margin-right: calc(50vw + 200px);
 
     margin-left:50vw;
 
     margin-left:50vw;
 
}
 
}
 +
*/
  
  
 
+
@media only screen and ( max-width: 900px ) {
 
+
@media screen and ( max-width: 800px ){
+
    #toc{
+
        display: none;
+
    }
+
 
     .content-text{
 
     .content-text{
    margin-right:50vw;
+
    margin-right:1em !important;
 +
    margin-left:1em !important;
 +
    width:90% !important;
 +
 
 +
   
 
     }
 
     }
 
}
 
}
 +
  
 
</style>
 
</style>
Line 163: Line 164:
  
 
         <div id="toc" class="toc">
 
         <div id="toc" class="toc">
             <div id="toctitle"><h2 id="toc-header">Contents</h2></div>
+
             <div id="toctitle"></div>
 
             <ul>
 
             <ul>
 
                 <li class="toclevel tocsection"><a href="#Project_Description" class="scroll"> <span id="whereYouAre"> Project Description  </span> </a>
 
                 <li class="toclevel tocsection"><a href="#Project_Description" class="scroll"> <span id="whereYouAre"> Project Description  </span> </a>
Line 355: Line 356:
  
  
 +
/*
 
   // Since side navigation is displayed at start at the very top and jumps down at scrolling
 
   // Since side navigation is displayed at start at the very top and jumps down at scrolling
 
   // ... We hide it a very short time, so we dont se it jumping down and then fade it in!  
 
   // ... We hide it a very short time, so we dont se it jumping down and then fade it in!  
Line 366: Line 368:
 
         else {  
 
         else {  
 
             // This is crucial for it to work!!!   
 
             // This is crucial for it to work!!!   
          $("#toc:visible").fadeOut("fast");  
+
            $("#toc:visible").fadeOut("fast");  
 
         }  
 
         }  
 
        
 
        
 
     });
 
     });
 
+
*/
  
  
Line 391: Line 393:
 
     e.preventDefault();
 
     e.preventDefault();
 
     $('body,html').animate({
 
     $('body,html').animate({
       scrollTop: $(this.hash).offset().top
+
       scrollTop: $(this.hash).offset().top - 50
 
     }, 1000 );
 
     }, 1000 );
 
   });
 
   });
Line 401: Line 403:
 
     scrollLink.each(function() {
 
     scrollLink.each(function() {
 
        
 
        
      var sectionOffset = $(this.hash).offset().top - 50;
+
        var sectionOffs = $(this.hash).offset().top;
     
+
      var sectionOffset =  sectionOffs - 100;
      if ( sectionOffset <= scrollbarLocation ) {
+
 
        $(this).parent().addClass('active');
+
        if ( sectionOffset <= scrollbarLocation ) {
        $(this).parent().siblings().removeClass('active');
+
              $(this).parent().addClass('active');
      }
+
              $(this).parent().siblings().removeClass('active');
    })
+
          }
 +
        })
 
      
 
      
  });
+
    });
 +
 
  
 
});
 
});

Latest revision as of 22:40, 17 October 2018




Uppsala iGEM 2018