Difference between revisions of "Template:Main2017"

Line 17: Line 17:
 
//load menu
 
//load menu
  
$( "#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() {
  
  
$('#accordion').find('.menu_item').click(function(){
+
$('#accordion').find('.menu_item').click(function(){
  
//Expand or collapse the panel that was clicked
+
//Expand or collapse the panel that was clicked
submenu = $(this).find('.submenu');
+
submenu = $(this).find('.submenu');
submenu.toggle();
+
submenu.toggle();
  
//Place the appropriate icon state on the panel that was clicked  
+
//Place the appropriate icon state on the panel that was clicked  
icon = $(this).find('.icon');
+
icon = $(this).find('.icon');
  
if ( !$( submenu ).is(':visible') ) {
+
if ( !$( submenu ).is(':visible') ) {
icon.removeClass("less").addClass("plus");
+
icon.removeClass("less").addClass("plus");
}
+
}
else {
+
else {
icon.removeClass("plus").addClass("less");
+
icon.removeClass("plus").addClass("less");
}
+
}
  
//Hide the other panels and switch all other icons to closed state
+
//Hide the other panels and switch all other icons to closed state
$(".submenu").not(submenu).hide();
+
$(".submenu").not(submenu).hide();
$(".icon").not(icon).removeClass("less").addClass("plus");
+
$(".icon").not(icon).removeClass("less").addClass("plus");
});
+
});
  
  
);
+
});
  
  

Revision as of 15:18, 14 November 2016