日期:2014-05-18  浏览次数:20832 次

FRAME框架和隐藏或者展开目录树综合应用问题 ???????
目前急需解决一个框架问题

我要实现的是两个框架嵌套中实现隐藏树型菜单的功能,在一个框架中实现是正常的,框架嵌套过程出现问题。。。。。。。

1、最外层框架如下:

<FRAMESET   border=0   frameSpacing=0   rows=58,*   TOPMARGIN= "0 "   LEFTMARGIN= "0 "   MARGINHEIGHT= "0 "   MARGINWIDTH= "0 "   frameborder= "0 "   borderColor= "#A1C7F9 ">

            <FRAME   border=0   name=fraToolbar   marginWidth=0   marginHeight=0   src= "top.jsp "   frameBorder=no     noresize   scrolling=no   TOPMARGIN= "0 "   LEFTMARGIN= "0 ">
            <FRAME   border=0   name= "FrameContent "   marginWidth=0   marginHeight=0   src= "mid.jsp "   frameBorder=no     noresize   scrolling=no   TOPMARGIN= "0 "   LEFTMARGIN= "0 ">

</FRAMESET>

mid.jsp内容调用一个包含文件如下:

<%@include   file= "tabbar.jsp "%>

tabbar.jsp是调用一个xml文件;

2、调用的内层框架mid.jsp内容如下:

<FRAMESET   name= "FrameContent "   border= "0 "   frameSpacing= "0 "   borderColor= "#A1C7F9 "   frameBorder= "0 "   cols= "10,200,10,* ">
    <FRAME   border= "0 "   name= "menus_swhidden "   src= "line.jsp "   noResize   scrolling= "no "   target= "_self ">
    <FRAME   name= "left1 "   src= "left/left_menu.jsp "   target= "_self ">
    <FRAME   border= "0 "   name= "menus_swhidden "   src= "menu_hidden.jsp "   noResize   scrolling= "no "   target= "_self ">
    <FRAME   name= "rightframe "   src= "module/default.jsp "   frameBorder= "no "   topmargin= "0 "   leftmargin= "0 ">
</FRAMESET>


3、在menu_hidden.jsp实现隐藏或展示树型菜单,出现问题:top.FrameContent.cols为空或者不是对象,menu_hidden.jsp内容:

<script   language= "javascript ">
function   ShowHideTree(){
alert( "wwwwww "+top.FrameContent.cols);
if   (top.FrameContent.cols!= "0,0,10,* "){
alert( "ssssssss ");
top.FrameContent.cols= "0,0,10,* ";
icon_arrow.src= "images/open_left.gif ";
}else{
alert( "wwwwww ");
top.FrameContent.cols= "10,200,10,* ";
icon_arrow.src= "images/close_left.gif ";
}
}
</script>

<table   height= "100% "   cellspacing= "0 "   cellpadding= "0 "   width= "10 "     background= "images/2.jpg "     border= "0 ">
    <tbody> <tr> <td   align=middle>
        <img   id= "icon_arrow "   title= "隐藏或者展开目录树 "   style= "cursor:   hand "   onclick= "ShowHideTree(); "   height= "138 "   src= "images/close_left.gif "     width= "10 ">
</td> </tr> </tbody>
</table>

怎么实现隐藏或者展开目录树???????????

------解决方案----