File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Accordion-Default value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Accordion-Default value" Watch "Accordion-Default value" New topic
Author

Accordion-Default value

Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Hi, I am developing a collapsable and expandable accordion in my page. I have the complete code, but, by default, i want that accodion to be in closed form. can any one please help me? Only when i click on description, it should open up another <div> to show the description.. can anyone tell me how to do it?

First.html


Java Script code


Now comes the .css code


Please help


Thanks & Regards,
Author
Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Any one Please help me!

Regards,
Author
K West
Ranch Hand

Joined: Sep 10, 2008
Posts: 58

Hi Aditi,

This should work





Years teach us more than books.
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
What K West said, and onClick description change the visibility.


SCJA
~Currently preparing for SCJP6
Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Brian Legg wrote:What K West said, and onClick description change the visibility.


I have tried both the suggessions. If I do display "none", it will not display onClick also....

i tried with changing onClick description, it is also not working.....there should be some simple solution for it.....i am not able to figure it.

please help.

Regards,
K West
Ranch Hand

Joined: Sep 10, 2008
Posts: 58

You have to only make the display:none, do nothing else, rest of the functionality and code remains the same.

Just use this, It works for me



All the Best
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accordion-Default value