Difference between revisions of "Template:Team:TU Eindhoven/Menu Script"
Line 107: | Line 107: | ||
break; | break; | ||
case '/Team:TU_Eindhoven/Project/Protocols': | case '/Team:TU_Eindhoven/Project/Protocols': | ||
+ | submenu = 3; | ||
+ | break; | ||
+ | case '/Team:TU_Eindhoven/Project': | ||
submenu = 3; | submenu = 3; | ||
break; | break; | ||
case '/Team:TU_Eindhoven/Notebook': | case '/Team:TU_Eindhoven/Notebook': | ||
+ | submenu = 3; | ||
+ | break; | ||
+ | case '/Team:TU_Eindhoven/Project/Expression_System': | ||
submenu = 3; | submenu = 3; | ||
break; | break; | ||
Line 142: | Line 148: | ||
submenu = 6; | submenu = 6; | ||
break; | break; | ||
− | case '/Team:TU_Eindhoven/Policy_Practices/ | + | case '/Team:TU_Eindhoven/Policy_Practices/Regulations': |
+ | submenu = 6; | ||
+ | break; | ||
+ | case '/Team:TU_Eindhoven/Policy_Practices/Stakeholders': | ||
submenu = 6; | submenu = 6; | ||
break; | break; | ||
− | case '/Team:TU_Eindhoven/Policy_Practices/ | + | case '/Team:TU_Eindhoven/Policy_Practices/Human_outreach': |
submenu = 6; | submenu = 6; | ||
break; | break; |
Revision as of 02:18, 19 September 2015
$(document).ready(function() { //uitklap zooi van hans JW is een BITCH HANS is CRACKIE $('.spoilerbutton').click(function() { var id = "spoiler" + $(this).attr("id").match(/\d+/); if ($(this).attr("src").indexOf("Uitgeklapt") != -1) { $(this).attr("src","https://static.igem.org/mediawiki/2015/8/87/TU_Eindhoven_Ingeklapt.png"); $('#' + id).slideToggle(); } else { $(this).attr("src","https://static.igem.org/mediawiki/2015/6/65/TU_Eindhoven_Uitgeklapt.png"); $('#' + id).slideToggle(); }; var element = $(this); element.css("pointer-events","none"); setTimeout(function(){element.css("pointer-events","auto")},400); }); //Wikitour $(document).ready(function(){ var landingPageHeight = $('#landingPage').height(); var windowHeight = $(window).height(); var scrollNow = landingPageHeight - windowHeight; //Check to see if the window is top if not then display button $(window).scroll(function(){ if ($(this).scrollTop() > scrollNow) { $('#wikiTour').fadeTo(0, 1); } else { $('#wikiTour').fadeTo(0, 0.4); $('#wikiTour').hover(function(){ $('#wikiTour').fadeTo(0,1); }); } }); }); //scroll zooi van hans $("a[href*=#]").click(function(e) { if($(this).hasClass("extern")){ return; } e.preventDefault(); var id= $(this).attr('href'); id = id.substring(id.lastIndexOf("#")); var el = $(id); //If there is no element with this id, check for name attribute if (el.length <= 0){ el = $('[name=' + id.substring(1)+ ']'); } $('html, body').animate({ scrollTop: el.offset().top - 40}, 1000); }); $(window).scroll(function(){ if( $(window).scrollTop() == 0){ $("#scrollUp").css("display","none"); } else{ $("#scrollUp").css("display","initial"); } $("#scrollUp").css("opacity", $(window).scrollTop() / 400); }); $("#scrollUp").click(function() { var h = window.innerHeight; h = h - 250; $("#scrollUp").css("bottom",h + "px"); setTimeout(function(){$('html, body').animate({ scrollTop: 0}, 1000);},700); setTimeout(function(){$("#scrollUp").css("display","none");$("#scrollUp").css("bottom","0");},1700); setTimeout(function(){$("#scrollUp").css("display","initial");},2400); }); // Get current Page locus=$(location).attr('pathname'); submenu = 0; switch (locus) { case '/Team:TU_Eindhoven': submenu = 1; break; case '/Team:TU_Eindhoven/Team': submenu = 2; break; case '/Team:TU_Eindhoven/Team/Members': submenu = 2; break; case '/Team:TU_Eindhoven/Team/Supervisors': submenu = 2; break; case '/Team:TU_Eindhoven/Attributions': submenu = 2; break; case '/Team:TU_Eindhoven/Description': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Design': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Experimental_Approach': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Protocols': submenu = 3; break; case '/Team:TU_Eindhoven/Project': submenu = 3; break; case '/Team:TU_Eindhoven/Notebook': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Expression_System': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Interlab': submenu = 4; break; case '/Team:TU_Eindhoven/ResultsHome': submenu = 4; break; case '/Team:TU_Eindhoven/Results': submenu = 4; break; case '/Team:TU_Eindhoven/Achievements': submenu = 4; break; case '/Team:TU_Eindhoven/Parts': submenu = 4; break; case '/Team:TU_Eindhoven/Modeling': submenu = 5; break; case '/Team:TU_Eindhoven/Modeling/Approach': submenu = 5; break; case '/Team:TU_Eindhoven/Modeling/Script': submenu = 5; break; case '/Team:TU_Eindhoven/Modeling/Results': submenu = 5; break; case '/Team:TU_Eindhoven/Practices': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Regulations': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Stakeholders': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Human_outreach': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Application_scenarios': submenu = 6; break; case '/Team:TU_Eindhoven/Collaborations': submenu = 7; break; case '/Team:TU_Eindhoven/Collaborations/CloningGuide': submenu = 7; break; case '/Team:TU_Eindhoven/Collaborations/AmoyNewsletter': submenu = 7; break; case '/Team:TU_Eindhoven/Collaborations/Collaboration_Attributions': submenu = 7; break; case '/Team:TU_Eindhoven/Team/Sponsors': submenu = 8; break; case '/Team:TU_Eindhoven/Safety/Lab': submenu = 9; break; case '/Team:TU_Eindhoven/Safety': submenu = 9; break; }; // "submenu" contains the number of the submenu to be shown by default (or 0 for none). // icon var link = document.createElement('link'); link.type = 'image/x-icon'; link.rel = 'shortcut icon'; link.href = 'https://static.igem.org/mediawiki/2015/4/4a/Logo_Eindhoven_small.png'; document.getElementsByTagName('head')[0].appendChild(link); //background $("