Team:Valencia UPV/Modeling/gene expresion

From 2014.igem.org

Revision as of 14:07, 3 September 2014 by Ivllobel (Talk | contribs)

$('#overlay').width($(window).width()).height($(window).height()); $(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'); } }); });