Hi all I am trying to make a section on a site that can toggle between hiding and showing div elements. What i want to do is have between 2-3 links at the top of a div that when clicked show the corresponding div underneath all the links. my html is
<div class="leftbottom"><a href="#" id="1" class="link"
name="1">comment</a> <a href="#" id="2" class="link"
<div id="box1" class="box"
<div id="box2" class="box"
I would like this all to work in a kind of accordion manner so that only one div id shown at a time and there is a sliding transition between them. I have this script already that will individually show each element but not swap between showing different elements
var id = $(this).attr('id');
$('#box' + id).toggle(500);
any help much appreciated cheers