X-Git-Url: https://git-public.kairo.at//?p=tricorder.git;a=blobdiff_plain;f=js%2Ftricorder.js;h=c1b61e7c389bd991a2229cae0eb8b8a8f040b0e5;hp=b04ac1292a61e72209bbf30be86ae3eb537bdb4e;hb=eabed1a435fb1ea52f189b7b0433bdb640a29137;hpb=feec2d1c201fbab44931a9d8b96915dcc95882c7 diff --git a/js/tricorder.js b/js/tricorder.js index b04ac12..c1b61e7 100644 --- a/js/tricorder.js +++ b/js/tricorder.js @@ -21,4 +21,18 @@ function updateStardate() { gStardate.textContent = sdateval.toFixed(1); setTimeout(updateStardate, 5*60*1000); -} \ No newline at end of file +} + +function switchModule(modname) { + var sections = document.getElementsByTagName('section'); + for (var i = 0; i <= sections.length - 1; i++) { + sections[i].classList.remove("active"); + } + var navs = document.getElementById('navlist').children; + for (var i = 0; i <= navs.length - 1; i++) { + navs[i].classList.remove("active"); + } + + document.getElementById("nav" + modname).classList.add("active"); + document.getElementById("sect" + modname).classList.add("active"); +}