我有一个论坛,左右型的框架页面(左边的框架页wleft.php,右边的框架页wmain.php)
怎样实现
当我点击左侧的一级版块,在一级版块下面展开二级版块,并且在右侧页面显示二级版块的简介(假设为123.html页面)呢? 
就像CSDN论坛的左侧导航树型菜单功能一样:比如说我点击“Java论坛”,不权展开该版块下面的子版块,而且在右侧显示java论坛的一些新帖
我用js只能做到:点击左侧的一级版块,左侧的一级版块下面展开二级版块,无法实现右侧同时显示二级版块的简介 论坛的框架页:
<html>
<frameset cols="150,*" frameborder="no" border="1" framespacing="0">
  <frame src="wleft.php" name="leftFrame" scrolling="AUTO" noresize="noresize" id="leftFrame" title="leftFrame" />
  <frame src="wmain.php" name="mainFrame" id="mainFrame" title="mainFrame" scrolling="AUTO" frameborder="NO"/>
</frameset>
<noframes><body>
</body>
</noframes>
</html>
左边的版块导航页:
<SCRIPT LANGUAGE="JavaScript">
<!--
function ShowSub(theId)
{
theFo = eval("fold_" + theId);
if (theFo.style.display == "none")
{
theFo.style.display = "block";
}
else
{
theFo.style.display = "none";
}/*
for (i = 0; i < 7; i++)
{
if (i == theId)
continue;
theFo = eval("tr_" + i);
theFo.style.display = "none";
}*/
}
//-->
</SCRIPT>
<table>
<!--一级栏目-->
<tr>
<td colspan=2><strong>+<a href="javascript:ShowSub('0')">一级版块</a></strong></td>
</tr>
<!--一级栏目下->1级子目录1-->
<tr id='fold_<?php echo $i++ ?>' style="display:none">
<td>
<table>
<!--2级子目录1_01-->
<tr>
<td colspan=2>二级版块1</td>
</tr>
<tr>
<td colspan=2>二级版块2</td>
</tr>
</table>
</td>
</tr>
</table>

解决方案 »

  1.   

    http://www.scriptlover.com/controls/main.html
      

  2.   

    http://www.scriptlover.com/controls/main.html
      

  3.   

    jquery有tree  你去看看 比这个好看 
    csdn写的比较死,都是循环,他的那些点都是循环加上去的,你可以看一下他的源码
      

  4.   


    js最近正想学,本人一点基础没有,jquery不懂啊,想从最基础的学起,以后会了再学jquery吧
      

  5.   

    这个好办!function ShowSub(theId)
    {
        theFo = eval("fold_" + theId);
        if (theFo.style.display == "none")
        {
            theFo.style.display = "block";
        }
        else
        {
            theFo.style.display = "none";
        }
        var linkHtml = "123.html"; //根据传进来的theId分析右侧要显示哪些页面。
        document.getElementById('mainFrame').src = "123.html";
      

  6.   

    function ShowSub(theId)
    {
        theFo = eval("fold_" + theId);
        if (theFo.style.display == "none")
        {
            theFo.style.display = "block";
        }
        else
        {
            theFo.style.display = "none";
        }
        var linkHtml = "123.html"; //根据传进来的theId分析右侧要显示哪些页面。牵涉到具体业务,不作讨论
        document.getElementById('mainFrame').src = linkHtml;}
      

  7.   

    这个是查询问题,一是节点要有链接
    二是集合查询,比如:点父节点时查其下所有子菜单的数据看看我仿CSDN写的(不同内核,不是梅花树):
    http://www.zzxj.net/forum/
      

  8.   

    我那个是ajax版的,曾写过纯js,纯PHP,及ajax三个版本,可惜一次没保存,在zend中删除项目,意外给我全删了
      

  9.   

    能把你的源码发给我学习一下吗?万分感谢[email protected]
      

  10.   

    求楼主把源码发给我学习一下好吗?谢谢了 [email protected]