I have a jQuery accordion that I have partially working. As of right now, I have it so all my paragraphs are hidden on page load & when a header is clicked, the paragraph is displayed but only one at a time. That part is working fine. But I cannot figure out how to also have the ability to close up all the paragraphs on another header click?
HTML
jQueryCode:<div id="list"> <h2>Heading #1</h2> <p>Here is some text</p> <h2>Heading #2</h2> <p>Here is more text</p> <h2>Heading #3</h2> <p>And here is even more text</p> </div>
Code:$(document).ready(function() { $('h2').click(function() { $('p').slideUp('slow'); $(this).next().slideDown('slow'); }); $("p").hide(); });


Reply With Quote

Bookmarks