Mark Harwood schreef: > Im trying to get my head around jQuery again, this time im wanting to > create a simple show hide system. > > I have a simple UL base menu and a couple of SPANs within a DIV which i > wish to show/hide depending on which link is clicked. > > Im unsure as to the best way of creating a custom function for doing so, > i wish to pass thru the ID of the div i want to show and then hide any > others that are shown, similar to the accordion plugin. > > Anyone able to help? > > simplest way i can think of is giving all the divs a class and then you could use
$('div.class').click(function(){ // to catch the id of the div $(this).attr('id'); // to hide and show $('div.class').hide(); $(this).show(); }); i'm not sure if $('div.class').not(this).hide() would work too? -- David Duymelinck ________________ [EMAIL PROTECTED] _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/