Team:Valencia Biocampus/Modeling temp2

From 2014.igem.org

Revision as of 16:19, 29 September 2014 by TonnyESP (Talk | contribs)

Modeling

Red

red red red red red red

Orange

orange orange orange orange orange

Yellow

yellow yellow yellow yellow yellow

Green

green green green green green

Blue

blue blue blue blue blue

$(document).ready(function() { // cache the id var navbox = $('#myTab'); // activate tab on click navbox.on('click', 'a', function (e) { // add a hash to the URL when the user clicks on a tab history.pushState(null, null, $(this).attr('href')); var $this = $(this); // prevent the Default behavior e.preventDefault(); // set the hash to the address bar window.location.hash = $this.attr('href'); // activate the clicked tab $this.tab('show'); //return false; }) // if we have a hash in the address bar if(window.location.hash){ // show right tab on load (read hash from address bar) $('a[href="'+window.location.hash+'"]').tab('show'); } // navigate to a tab when the history changes window.addEventListener("popstate", function(e) { var activeTab = $('[href=' + location.hash + ']'); if (activeTab.length) { activeTab.tab('show'); } else { $('.nav-tabs a:first').tab('show'); } }); });