Team:UNITN-Trento/JS/Subs/Header

From 2013.igem.org

Revision as of 12:11, 9 September 2013 by Ggirelli (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

$(document).ready(function() { $("#tn-menu > .hasSub > a").each(function() { $(this).click(function(e) { e.preventDefault(); }); $(this).mouseenter(function() { $("#tn-menu > li").removeClass("active"); $("#tn-menu > li > ul").css({'display' : 'none'});

$(this).parent().addClass("active") $(this).click(function() { document.location.href = $(this).attr('href'); }); $(this).parent().children("ul").css({'display' : 'block'}); }) }); $("#tn-menu > li:not(.hasSub) > a").each(function() { $(this).mouseenter(function() { $("#tn-menu > li").removeClass("active"); $("#tn-menu > li > ul").css({'display' : 'none'}); $(this).parent().addClass("active") }) }); });