O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an accordion style menu

Accordions can also be used as a menu. The content part of an accordion can be used in many ways. In this recipe, we will create a simple accordion and will use it as a menu. Headers of the accordion reveal the content section. This content section will have some text and a Read More link. Clicking on this link will request the related content from a PHP script and will display it on the page.

It can be very handy in cases when you want to show the user only a summary of something (say a product) instead of lengthy details. If the user finds the summary interesting, he can click the link and can read the full details on the page. It can save a lot of space, which means more data can be displayed in the saved space. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required