Difference between revisions of "Template:Team:TU Eindhoven/Menu Script"
Line 150: | Line 150: | ||
function() { | function() { | ||
a = 6; | a = 6; | ||
+ | }); | ||
+ | $("#menu7").hover( | ||
+ | function() { | ||
+ | a = 7; | ||
+ | }); | ||
+ | $("#menu8").hover( | ||
+ | function() { | ||
+ | a = 8; | ||
}); | }); | ||
Line 175: | Line 183: | ||
case 5: | case 5: | ||
$("#menu5").css("color", "#9DC671"); | $("#menu5").css("color", "#9DC671"); | ||
+ | $("#submenu").css("height", "60px"); | ||
+ | break; | ||
+ | case 6: | ||
+ | $("#menu6").css("color", "#9DC671"); | ||
+ | $("#submenu").css("height", "60px"); | ||
+ | break; | ||
+ | case 7: | ||
+ | $("#menu7").css("color", "#9DC671"); | ||
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
break; | break; | ||
Line 189: | Line 205: | ||
//reset alles en display dan alleen de juiste | //reset alles en display dan alleen de juiste | ||
$("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); | ||
− | $("#sub2,#sub3,#sub4,#sub5").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); |
switch (a) { | switch (a) { | ||
case 1: | case 1: | ||
Line 247: | Line 263: | ||
if (submenu == 1 || submenu == 8 ){ | if (submenu == 1 || submenu == 8 ){ | ||
$("#submenu").css("height", "0"); | $("#submenu").css("height", "0"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); |
− | $("#sub2,#sub3,#sub4,#sub5").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); |
$("#menu"+submenu.toString()).css("color", "#9DC671"); | $("#menu"+submenu.toString()).css("color", "#9DC671"); | ||
} | } | ||
else{ | else{ | ||
− | $("#sub2,#sub3,#sub4,#sub5").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); |
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); |
$("#sub"+submenu.toString()).css("display","block"); | $("#sub"+submenu.toString()).css("display","block"); | ||
$("#menu"+submenu.toString()).css("color", "#9DC671"); | $("#menu"+submenu.toString()).css("color", "#9DC671"); |
Revision as of 13:37, 28 August 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); }); //scroll zooi van hans jQuery(window).on("hashchange", function () { window.scrollTo(window.scrollX, window.scrollY - 100); }); // 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/Notebook': submenu = 3; break; case '/Team:TU_Eindhoven/Project/Interlab': submenu = 3; break; case '/Team:TU_Eindhoven/Results': submenu = 4; break; case '/Team:TU_Eindhoven/Project/Modelling': submenu = 5; break; case '/Team:TU_Eindhoven/Practices': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Timeline': submenu = 6; break; case '/Team:TU_Eindhoven/Policy_Practices/Educational_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/Team/Sponsors': submenu = 8; 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 $("