Hi, I want to include a number of boxes on a page that reveal content when clicked. I seem to have these working ok, although when one box is open, i have to click twice on another to get it to work. You can view this in action here: http://www.dave-tyler.co.uk/showcasetest4.html Is there a way i can stop this from happening? Many thanks for your help
Yeah, use slideToggle. Replace that huge if..else block with this: $("#show a").click(function () { $(this).next().slideToggle(); }); Code (markup): Shouldn't really use next, but I had no luck selecting the div itself. Think I need to brush up on selectors
Ok, this is probably better to use: $("#show a").click(function () { $(this).siblings("div").slideToggle(); }); Code (markup):