I'm searching for a jQuery accordion like the one that can be found on the avg website with no luck, so I'm hoping someone here can point me into the right direction. To source code or an example.
I already have the accordion working but it's the read more/close feature that is missing and that I want to use.
Jquery UI is great, but its a lot of extra stuff just for one little accordion. If you are going to use all of the features, then go for it.
You could also just use the jQuery methods show(), hide() or toggle(). Follow the links to learn about those, I won't explain them here.
The problem with all of those is they show or hide ALL of the text, as some of the other answers here demonstrate. If you want to show a line or two (or ten) of the actual text, then display all of it by clicking a button/link, you need a little more than the canned methods. If you just want a little script to do that, or just want to understand how its done, here is my little plugin. My script animates the open and closing of the accordion similar to show()/hide(), but will show a pre-defined amount of text in the closed position.
Fiddle
Hope this helps
HTML
CSS
jQuery
});
Jquery UI Accordion does what you want. Specifically look at the collapsible feature.
Working example: Fiddle
HTML
Jquery UI (accordion)
Then just style it to your flavor.
CSS
Using Jquery UI can be nice because they've already added things like support for up/down keys and you can easily change the animation types. You can also capture the event for activate and change the text of the header if you want.