Difference between revisions of "Template:Team:TU Eindhoven/Menu Script"
Line 165: | Line 165: | ||
function() { | function() { | ||
a = 8; | a = 8; | ||
+ | }); | ||
+ | $("#menu9").hover( | ||
+ | function() { | ||
+ | a = 9; | ||
}); | }); | ||
Line 200: | Line 204: | ||
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
break; | break; | ||
− | case | + | case 9: |
$("#menu7").css("color", "#9DC671"); | $("#menu7").css("color", "#9DC671"); | ||
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
Line 211: | Line 215: | ||
}); | }); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").hover( | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8,#menu9").hover( |
function() { | function() { | ||
menuhover = 1; | menuhover = 1; | ||
//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,#menu9").css("color", "#004415"); |
− | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7,#sub9").css("display","none"); |
switch (a) { | switch (a) { | ||
case 1: | case 1: | ||
Line 255: | Line 259: | ||
$("#menu8").css("color", "#9DC671"); | $("#menu8").css("color", "#9DC671"); | ||
$("#submenu").css("height", "0px"); | $("#submenu").css("height", "0px"); | ||
+ | break; | ||
+ | case 9: | ||
+ | $("#menu9").css("color", "#9DC671"); | ||
+ | $("#sub9").css("display","block"); | ||
+ | $("#submenu").css("height", "60px"); | ||
break; | break; | ||
} | } | ||
Line 274: | Line 283: | ||
if (submenu == 1 || submenu == 8 ){ | if (submenu == 1 || submenu == 8 ){ | ||
$("#submenu").css("height", "0"); | $("#submenu").css("height", "0"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8,#menu9").css("color", "#004415"); |
− | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7,#sub9").css("display","none"); |
$("#menu"+submenu.toString()).css("color", "#9DC671"); | $("#menu"+submenu.toString()).css("color", "#9DC671"); | ||
} | } | ||
else{ | else{ | ||
− | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7").css("display","none"); | + | $("#sub2,#sub3,#sub4,#sub5,#sub6,#sub7,#sub9").css("display","none"); |
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8,#menu9").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 11:50, 1 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); }); //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 = 4; break; case '/Team:TU_Eindhoven/Results': submenu = 4; break; case '/Team:TU_Eindhoven/Modeling': 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/Collaborations/Collaboration_Attributions': 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 $("