需要帮助来编码折叠菜单 [英] Need help to code collapsing menu

查看:49
本文介绍了需要帮助来编码折叠菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试为网页编写菜单,菜单分组为

即:
< br $>
首页

Group1

?* menuitem1

?* menuitem2

?* menuitem3

Group2

?*?* menuitem1

?*?* menuitem2

?* menuitem3

依此类推。


我想要实现的是群组以折叠状态显示

,具体取决于当前页面正在显示ie即所以它开始

这样出来


首页

Group1

Group2


如果你单击Group1它会加载第一个menuitem页面并突出显示它

并重新绘制扩展该组的页面即(注意*表示高亮度)

首页

Group1

?*?* menuitem1

?*?*?* menuitem2

?*?*?* menuitem3?*

Group2


如果你点击Group2就是这样的,即:

首页

Group1

Group2

?*?* menuitem1

?*?*?*?* menuitem2

?*?*?*?* menuitem3?*


最好的方法是什么?我编写了很长的路要走,

有很多重复的代码。


我希望这一切都有意义而且我有清楚地解释了。


我是php的新手,所以非常感谢你的帮助,因为我完全处理了如何最好地完成这项工作的损失。<非常感谢
非常感谢


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

推荐答案

< comp .lang.php,rigga, ri***@hasnomail.com >

< 42 * **********************@ptn-nntp-reader01.plus.net>

<星期五,2005年7月8日19: 12:36 + 0100>
<comp.lang.php , rigga , ri***@hasnomail.com>
<42***********************@ptn-nntp-reader01.plus.net>
<Fri, 08 Jul 2005 19:12:36 +0100>
最好的方法是什么?我已经编写了很长的路要走,其中有很多重复的代码。

我希望这一切都有意义并且我已经清楚地解释了它。

我是php的新手,所以非常感谢你的帮助,因为我完全无法做到这一点。
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.




使用包括应该让它变得非常容易 - 即使是像我这样的新手。


blah.php?pass = 1在你的主要组链接上。


假设您将导航菜单作为包含,您可以执行if,如果

值为1,则显示额外的子菜单链接。


虽然,你也需要在所有子链接上使用?pass = 1或者

当你点击子链接时子菜单会消失。


作为一个家伙php新手,我发现首先工作的东西然后

试图调整并稍后调整它可能是有用的。



Using includes should make it quite easy - even for a newbie like me .

blah.php?pass=1 on your main group link .

Assuming you have the nav menu as a include you could do a ''if'' and if
the value is 1 then display the extra sub menu links .

Although , You would need the ?pass=1 on all the sub links as well or
the sub menu would disappear when you clicked on sub link .

As a fellow php newbie i''ve found getting stuff working first and then
trying to tweak and fine tune it later can be useful .

SOR写道:
SOR wrote:
< comp.lang.php,rigga, ri***@hasnomail.com >
< 42 *********************** @ ptn-nntp-reader01.plus.net>
<星期五,2005年7月8日19 :12:36 + 0100>
<comp.lang.php , rigga , ri***@hasnomail.com>
<42***********************@ptn-nntp-reader01.plus.net>
<Fri, 08 Jul 2005 19:12:36 +0100>
最好的方法是什么?我已经把它编码为很长的路要走,这里有很多重复的代码。

我希望这一切都有意义并且我已经清楚地解释了它。

我是php的新手,所以非常感谢你的帮助,因为我完全不知道如何做到这一点。
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.



使用包含应该是它非常容易 - 即使对于像我这样的新手。

blah.php?pass = 1在您的主要组链接上。

假设您有导航菜单作为包含,你可以做一个'if''并且如果
值为1则显示额外的子菜单链接。

虽然,你需要在所有子链接上都有?pass = 1或者当你点击子链接时,子菜单会消失。

作为一个家伙php新手我发现首先工作然后
试图调整和罚款以后调整它可能很有用。



Using includes should make it quite easy - even for a newbie like me .

blah.php?pass=1 on your main group link .

Assuming you have the nav menu as a include you could do a ''if'' and if
the value is 1 then display the extra sub menu links .

Although , You would need the ?pass=1 on all the sub links as well or
the sub menu would disappear when you clicked on sub link .

As a fellow php newbie i''ve found getting stuff working first and then
trying to tweak and fine tune it later can be useful .



你能进一步解释一下吗?我怎样才能使它成为活跃的链接?


Could you explain further?, how would I get it to highlite the active link?


< comp.lang.php,rigga, ri *** @ hasnomail.com >

< 42 ********************** @ ptn-nntp-reader04.plus.net>

<星期六,09七月2005 09:11:39 + 0100>
<comp.lang.php , rigga , ri***@hasnomail.com>
<42**********************@ptn-nntp-reader04.plus.net>
<Sat, 09 Jul 2005 09:11:39 +0100>
你能进一步解释一下吗?我怎样才能让它成为活跃的链接?
Could you explain further?, how would I get it to highlite the active link?



www.snipe.net 这个家伙导航菜单使用你想做的事情 -

它可能值得一封电子邮件,要求他提供源代码作为他的方法

可能比我的好。



www.snipe.net this guys nav menu uses the sort of thing you want to do -
it might be worth a email to ask him for the source code as his method
is probably better than mine .


这篇关于需要帮助来编码折叠菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆