Team:TU Munich/lab/notebook

From 2011.igem.org

Revision as of 11:05, 14 September 2011 by FabianFroehlich (Talk | contribs)

$(function () { var tabContainers = $('div.tabs > div'); $('div.tabs ul.tabNavigation a').click(function () { tabContainers.hide().filter(this.hash).show(); $('div.tabs ul.tabNavigation a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); }); $(function () { var tabs = []; var tabContainers = []; $('ul.tabs a').each(function () { // note that this only compares the pathname, not the entire url // which actually may be required for a more terse solution. if (this.pathname == window.location.pathname) { tabs.push(this); tabContainers.push($(this.hash).get(0)); } }); $(tabs).click(function () { // hide all tabs $(tabContainers).hide().filter(this.hash).show(); // set up the selected class $(tabs).removeClass('selected'); $(this).addClass('selected'); return false; }); });

Labbook