Expand and Collapse effect

hi folks,
i was just getting started to learn about how to have expand and collapse effects, i work on css and html, but i saw collapse and expand effect on few website, so i wanted to learn it. i m just a starter in JavaScript and jQuery, so wanted some advice, where should i start? appreciate anyone who would contribute to my knowledge

The documentation for the jQuery accordion says that there is an “active” option that can be set to false, which displays none of them at the start.

Here is an example of how it would be used:


$( "#accordion" ).accordion({ active: false });

Yes i understand Accordion (as i play music myself ) so its open panel opened at a time. i don’t want multiple panel opened at same. what i need s when a person open my page. all of the Accordions are closed by default having said that just like a person click one panel to open it, clicking it again should close it. now i am just a starter in jQuery so i know nothing. i was wondering if you can help me modifying the needs i want. thanks

Will you also be allowing multiple panels open at the same time?

An Accordion is where only 1 panel is open at any time. There are different solutions available depending on whether you’ll also allow more than one panel to be open. Will you be restricting things to being only 0 or 1 panel open at any time, or will more be also allowed?

hey pmw57. as i told i am using the accordion jQuery link you told me. now i am in need of something else. by default one div is opened. i want all div closed on default. how can i modify that? :frowning:

They’re easy to code and manage. You know best whether accordions or tree vies are more suitable to what you’re wanting to achieve. You have links in my previous post to demos about them, along with documentation too, so you can see them, use them, and determine which of the types are more suited for you.

so as i m starter in jQuery, how do u rate the accordions, as it is fit for what i was looking

These effects just involve using onclick events to trigger code that shows or hides other parts of the page.

There can be some interesting complexities though, so as you mentioned jQuery, that has accordions and [url=“http://jquery.bassistance.de/treeview/demo/”]treeviews as good common starting points.