[jQuery] Re: show element if class matches current bod y id (Please help) « View previous topic :: View next topi c » Author

2009-04-19 Thread mkmanning
I posted on the duplicate of this, so I'll try here to :) 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; } Waiting until domready to hid

[jQuery] Re: show element if class matches current bod y id (Please help) « View previous topic :: View next topi c » Author

2009-04-18 Thread Chuck Harmston
Hi Matt, Give this a shot: $(document).ready( function(){ $( '#menu ul' ).hide(); $( '#menu li.' + $( 'body' ).attr( 'id' ) + ' ul' ).show(); }); Demo here: http://jsbin.com/ehape Chuck Harmston http://chuckharmston.com On Sat, Apr 18, 2009 at 10:50 AM, Max wrote: > > hi Im