Help - Search - Member List - Calendar
Full Version: Need help to code collapsing menu
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
rigga
Hi,

I am trying to code a menu for a webpage, the menu is broken up to groups
i.e:

Home
Group1
menuitem1
menuitem2
menuitem3
Group2
menuitem1
menuitem2
menuitem3
And so on.

What I want to achieve is that the groups are shown in a collapsed state
depending on the page which is currently being displayed i.e so it starts
out like this

Home
Group1
Group2

If you click on Group1 it loads the first menuitem page and highlights it
and redraws the page expanding that group i.e. (note * denotes highligthed)


Home
Group1
*menuitem1*
menuitem2
menuitem3
Group2

And the same would apply if you click on Group2 i.e:


Home
Group1
Group2
*menuitem1*
menuitem2
menuitem3

What is the best way to go about this? I have coded it 'the long way' where
there is lots of duplication of code.

I hope this all makes sense and that I have explained it clearly.

I am new to php so would really appreciate your help as I am totally at a
loss on how to best do this.

Many thanks

Rigga

Colin McKinnon
rigga wrote:

QUOTE
Hi,

I am trying to code a menu for a webpage, the menu is broken up to groups
i.e:

Home
Group1
menuitem1
<snip
What is the best way to go about this? I have coded it 'the long way'
where there is lots of duplication of code.


Use Marco Pratesi's php layers menu
(http://phplayersmenu.sourceforge.net/demo.php)

C.


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.