Sub Categories How To Hide And Restore With One Click

Sub categories how to hide and restore with one click?

Example Category

"Widget" is created.

3 subcategories are created:

Widget A

Widget B

Widget C

The text category links are lined up flush left on the home page like this:

By default only this shows:

Version 1

Widgets

Then you can click on "widgets" and it opens to look like this:

Version 2

Widgets

Widget A

Widget B

Widget C

I can easily create version one and two but how do get the subcategories to open and close by just clicking on them?

I ended up using Alt Team's accordian addon