Difference between revisions of "Team:Uppsala/test5"

Line 354: Line 354:
 
$( document ).ready(function() {
 
$( document ).ready(function() {
  
 +
$(window).resize(function() {
 +
if ( $(window).width() < 800) {
  
 
   // 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
Line 401: Line 403:
 
     scrollLink.each(function() {
 
     scrollLink.each(function() {
 
        
 
        
      var sectionOffs = $(this.hash).offset().top;
+
        var sectionOffs = $(this.hash).offset().top;
 
       var sectionOffset =  sectionOffs - 100;
 
       var sectionOffset =  sectionOffs - 100;
  
      if ( sectionOffset <= scrollbarLocation ) {
+
        if ( sectionOffset <= scrollbarLocation ) {
        $(this).parent().addClass('active');
+
              $(this).parent().addClass('active');
        $(this).parent().siblings().removeClass('active');
+
              $(this).parent().siblings().removeClass('active');
      }
+
          }
    })
+
        })
 
      
 
      
  });
+
    });
  
 +
  }
 +
 +
else {
 +
    $("#toc").css('visibility','hidden');
 +
}
 +
 +
  });
 
});
 
});
  

Revision as of 01:34, 17 October 2018




Uppsala iGEM 2018