Hi Guys, I need some advice, I've been using and accordian as per an example I found somewhere: <script> $(document).ready(function(){ $("dd:not(:first)").hide(); $("dt a").click(function(){ $("dd:visible").slideUp("slow"); $(this).parent().next().slideDown("slow"); return false; }); }); </script> This works on a list like the below: <dt><a href="#"><h4>Heading</h4></a></dt> <dd>List like this</dd>
When you click on a DT it closes all open DDs. I now need to change this so that it will check to see if the DD is visible. If it is to close the DD of the clicked DT. If it's not open to open it. One of the demo's on this page - http://ui.jquery.com/demos/accordion/#collapsible does what I want but: 1) I'd have to change all my DT / DDs to 2) I'll not have learnt anything other than to copy and paste. Thanks James I've been trying for ages to find the syntax to do this, but I'm having no success.... I don't seem to get the syntax and / or the DOM navigation theory. Can anybody point me in the right direction please. James