Team:Shenzhen SFLS/comm/javascripts
From 2013hs.igem.org
(Difference between revisions)
Line 42: | Line 42: | ||
$(".nav_sub").slideUp('slow'); | $(".nav_sub").slideUp('slow'); | ||
}); | }); | ||
+ | |||
if(_menuItem[_index].menu=='menu') | if(_menuItem[_index].menu=='menu') | ||
- | $('.nav li').eq(_index).addClass('active_select'); | + | $('.nav li').siblings().eq(_index).addClass('active_select'); |
else | else | ||
- | $('.nav li').eq(_index).addClass('active_parent_select'); | + | $('.nav li').siblings().eq(_index).addClass('active_parent_select'); |
- | + | ||
- | + | ||
} | } |
Revision as of 17:11, 21 June 2013
function menu_active(_index) {
var $menu = $('var $menu_context; var _menuItem = [{ 'txt': 'Home','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS','submenu':[] }, { 'txt': 'Team','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Team','submenu':[] }, { 'txt': 'Project','menu':'menu_parent', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Project',
'submenu':[{'txt': 'biosafety','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Biosafety'}] },
{ 'txt': 'Notebook','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Notebook','submenu':[] }, { 'txt': 'Results','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Results' ,'submenu':[]}, { 'txt': 'Human practices','menu':'menu', 'link': 'https://2013hs.igem.org/Team:Shenzhen_SFLS/Human' ,'submenu':[]}];
for (var i = 0; i < _menuItem.length; i++) {$menu_context=$('