Collapsing Database Displays

Before I try to explain what I’m trying to do, let me show you an example -

http://www.catalogueoflife.org/annual-checklist/2012/browse/tree/id/2339542

The page displays a list of taxons (in this case, phyla) in a parent-child relationship, with the parent being animals (Animalia). If you click on a tiny box with a + sign, it displays that particular phyla’s children. If you choose Chordata, it displays a list of children that include class Mammalia (mammals), and so on.

Anyway, I’d like to do something similar on my website, which focuses on animals and plants. I already have PHP/MySQL queries that display each taxon’s children. I’d just like to know how to make them display with the little boxes that expand and collapse the children, menu or whatever they’re called.

Thanks!

You’d normally do effects like that with JavaScript—such as with an accordion script: http://jqueryui.com/accordion/. However, that’s not really the script you want in this case.

I’ve moved this to the JavaScript forum, where someone will know of a script that does exactly what you want. :slight_smile: