Difference between revisions of "Template:Main2017"

Line 19: Line 19:
 
$( "#load_menu_here" ).load("https://2017.igem.org/HQ:Menu #Main_menu", function() {
 
$( "#load_menu_here" ).load("https://2017.igem.org/HQ:Menu #Main_menu", function() {
  
 +
menu_functionality();
 +
 +
});
 +
 +
 +
 +
 +
 +
 +
//menu functionality
 +
function menu_functionality() {
  
 
$('#accordion').find('.menu_item').click(function(){
 
$('#accordion').find('.menu_item').click(function(){
Line 41: Line 52:
 
});
 
});
  
 
});
 
 
 
 
 
//name setup
 
 
if ( wgPageName.substring( 0,  8) == "Template")  {  // if the page is a template it displays the full name in a single line
 
$("#team_name").html( wgPageName );
 
 
}
 
}
 
else if (  ( (wgPageName.match(/\//g) || []).length ) == 0 ) {  // if it is the home page , just print the team's name
 
$("#team_name").html( wgPageName.substring( 5, wgPageName.length ) );
 
}
 
 
else {
 
// this adds the team's name as an h1
 
$("#team_name").html( wgPageName.substring( 5 , wgPageName.indexOf("/")  ) );
 
 
// this adds the page's title as an h4
 
$("#page_name").html (    ( wgPageName.substring( wgPageName.indexOf("/") + 1, wgPageName.length ) ).replace( /\/|_/g , " ")  );
 
}
 
 
 
 
//menu functionality
 
 
 
  
 
$(".collapsable_menu_control").click(function() {
 
$(".collapsable_menu_control").click(function() {

Revision as of 15:43, 14 November 2016