[jQuery] Re: show if class matches current body id

2009-04-18 Thread mkmanning
Is there any particular reason you need JavaScript to do this, instead of just using CSS? #menu ul { display:none; } body#foo ul.foo, body#bar ul.bar, body#foobar ul.foobar { display:block; } On Apr 18, 10:05 am, Max wrote: > Thanks so much for the reply. > however i may have

[jQuery] Re: show if class matches current body id

2009-04-18 Thread Max
Thanks so much for the reply. however i may have worded my question poorly. I need the if statement to replace $('#menu ul.test').show(); so that instead the with class test, only the ul with the class matching the body is shown. the rest are hidden. thanks again -Max On Apr 18, 6:50 pm, Nic

[jQuery] Re: show if class matches current body id

2009-04-18 Thread Nic Hubbard
function initMenu() { if ($('body').attr('id') === $('#menu ul').attr('class')) { $('#menu ul').hide(); $('#menu ul.test').show(); $('#menu li a').click( function() { $(this).next().togg