Template:Team:Waterloo/JS/baseWiki

From 2014.igem.org

(Difference between revisions)
 
(6 intermediate revisions not shown)
Line 6: Line 6:
function alignHeadings(){
function alignHeadings(){
   var remainingWidth = $("div#topbar").width();
   var remainingWidth = $("div#topbar").width();
-
  if (remainingWidth <= "1000"){
 
-
    $("ul#headings >li").css("display", "none");
 
-
    $("ul#shortheadings >li").css("display", "block");
 
-
  }
 
-
  else {
 
     var allheadings = $("ul#headings >li");
     var allheadings = $("ul#headings >li");
     allheadings.css("display", "block");
     allheadings.css("display", "block");
Line 16: Line 11:
     allheadings.width(remainingWidth / (allheadings.length + 0.5))
     allheadings.width(remainingWidth / (allheadings.length + 0.5))
       .css({"text-align":"center","line-height":"150%"});
       .css({"text-align":"center","line-height":"150%"});
-
  }
 
}
}
Line 43: Line 37:
}
}
-
$('ul.tabs').each(function(){
+
/*$('ul.tabs').each(function(){
-
    // For each set of tabs, we want to keep track of
+
-
    // which tab is active and it's associated content
+
     var $active, $content, $links = $(this).find('a');
     var $active, $content, $links = $(this).find('a');
-
    // If the location.hash matches one of the links, use that as the active tab.
 
-
    // If no match is found, use the first link as the initial active tab.
 
     $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]);
     $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]);
-
     $active.addClass('active');
+
     $active.addClass('selected');
     $content = $($active[0].hash);
     $content = $($active[0].hash);
-
    // Hide the remaining content
 
     $links.not($active).each(function () {
     $links.not($active).each(function () {
       $(this.hash).hide();
       $(this.hash).hide();
     });
     });
-
    // Bind the click event handler
 
     $(this).on('click', 'a', function(e){
     $(this).on('click', 'a', function(e){
-
      // Make the old tab inactive.
+
 
-
       $active.removeClass('active');
+
       $active.removeClass('selected');
       $content.hide();
       $content.hide();
-
      // Update the variables with the new link and content
 
       $active = $(this);
       $active = $(this);
       $content = $(this.hash);
       $content = $(this.hash);
-
      // Make the tab active.
+
       $active.addClass('selected');
-
       $active.addClass('active');
+
       $content.show();
       $content.show();
-
      // Prevent the anchor's default click action
 
       e.preventDefault();
       e.preventDefault();
     });
     });
-
   });
+
   });*/
-
 
+
</script>
</script>
</html>
</html>

Latest revision as of 05:06, 16 October 2014