Difference between revisions of "Template:Team:TU Eindhoven/Menu Script"
Line 98: | Line 98: | ||
function() { | function() { | ||
$("#twitter").css("z-index","11"); | $("#twitter").css("z-index","11"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); |
$("#submenu").css("height","0px"); | $("#submenu").css("height","0px"); | ||
fb_twit = 1; | fb_twit = 1; | ||
Line 111: | Line 111: | ||
function() { | function() { | ||
$("#facebook").css("z-index","11"); | $("#facebook").css("z-index","11"); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6").css("color", "#004415"); | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").css("color", "#004415"); |
$("#submenu").css("height","0px"); | $("#submenu").css("height","0px"); | ||
fb_twit = 1; | fb_twit = 1; | ||
Line 144: | Line 144: | ||
function() { | function() { | ||
a = 6; | a = 6; | ||
+ | $("#menu7").hover( | ||
+ | function() { | ||
+ | a = 7; | ||
+ | $("#menu8").hover( | ||
+ | function() { | ||
+ | a = 8; | ||
}); | }); | ||
Line 169: | Line 175: | ||
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"); | ||
+ | break; | ||
+ | case 8: | ||
+ | $("#menu8").css("color", "#9DC671"); | ||
$("#submenu").css("height", "60px"); | $("#submenu").css("height", "60px"); | ||
break; | break; | ||
Line 178: | Line 196: | ||
}); | }); | ||
− | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6").hover( | + | $("#menu1,#menu2,#menu3,#menu4,#menu5,#menu6,#menu7,#menu8").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").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,#sub8").css("display","none"); |
switch (a) { | switch (a) { | ||
case 1: | case 1: | ||
Line 211: | Line 229: | ||
case 6: | case 6: | ||
$("#menu6").css("color", "#9DC671"); | $("#menu6").css("color", "#9DC671"); | ||
+ | $("#sub6").css("display","block"); | ||
+ | $("#submenu").css("height", "0px"); | ||
+ | break; | ||
+ | case 7: | ||
+ | $("#menu7").css("color", "#9DC671"); | ||
+ | $("#sub7").css("display","block"); | ||
+ | $("#submenu").css("height", "0px"); | ||
+ | break; | ||
+ | case 8: | ||
+ | $("#menu8").css("color", "#9DC671"); | ||
+ | $("#sub8").css("display","block"); | ||
$("#submenu").css("height", "0px"); | $("#submenu").css("height", "0px"); | ||
break; | break; | ||
Line 231: | Line 260: | ||
if (submenu == 1 || submenu == 6 ){ | if (submenu == 1 || submenu == 6 ){ | ||
$("#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,#sub8").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,#sub7,#sub8").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 12:41, 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/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 = 5; break; case '/Team:TU_Eindhoven/Collaborations/CloningGuide': submenu = 5; break; case '/Team:TU_Eindhoven/Collaborations/AmoyNewsletter': submenu = 5; break; case '/Team:TU_Eindhoven/Team/Sponsors': submenu = 6; 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 $("