日期:2014-05-16  浏览次数:20451 次

怎么关闭左边的导航条
很多论坛都有的,比如猫扑网站的论坛就是这个样式,好像是左右分帧的frame框架,左边是个导航条,右边是文本内容,就是左边的frame是一个分类,右边是条目,当不想看左边的导航条的时候,在frame的边框上有一个按钮,点一下左边的frame就收回去了,再点一次,又展开了,这个是怎么做的?我看了一下他们的代码,好复杂哦,我想没那么复杂吧,就是从新改变一下左边frame的比例,可是那个按钮是怎么加到边框上的呢?或是根本不是frame框架?左边就是一个隐藏层?请老师们指教,谢谢谢谢
有代码粘贴上更好啦,尽量代码简洁一些,比如下面这个猫扑网站就是这个样子的,
http://dzh.mop.com/       就是要这个效果

------解决方案--------------------
<frameset rows= "51,*,0,0 " frameborder= "0 " border= "0 " framespacing= "0 ">
<frame name= "daoHangTiao " id= "daoHangTiao " src= "/daoHangTiao.jsp " scrolling= "no " frameborder= "0 " noresize>
<frameset name= "main " cols= "503,* " scrolling= "auto " frameborder= "0 " border= "0 " framespacing= "1 ">
<frame name= "leftFrame " id= "leftFrame " scrolling= "no " src= "/leftFrame.jsp?type=2&tp=&refer= " frameborder=0 scrolling= "no " marginwidth= "0 " marginheight= "0 " border=0 framespacing= "0 ">
<frame name= "right " id= "right " src= "http://www.mop.com/3/274.html " scrolling= "auto " border=0 frameborder=0 framespacing= "0 ">
</frameset>

<frame name= "online " src= "http://search.mop.com/online.jsp " scrolling= "no " framespacing= "0 " border= "0 " frameborder= "0 " noresize>
<frame name= "function " src= "http://dzh.mop.com/function.jsp " scrolling= "no " framespacing= "0 " border= "0 " frameborder= "0 " noresize>
</frameset>


--------------------------------------网扑的frame的代码.


function mainCenterClick(){
try{
if(main.cols!= "6,* ") {
main.cols= "6,* ";
//mainCenter.document.getElementById( "ImgArrow ").src= "http://txt.mop.com/dzh/centerframe/al2.gif ";
}else{
main.cols= "503,* "
//mainCenter.document.getElementById( "ImgArrow ").src= "http://txt.mop.com/dzh/centerframe/al2.gif ";
}
/*
if(main.cols== "503,* ") {
main.cols= "6,* ";
//mainCenter.document.getElementById( "ImgArrow ").src= "http://txt.mop.com/dzh/centerframe/al2.gif ";
}else{
main.cols= "503,* "
//mainCenter.document.getElementById( "ImgArrow ").src= "http://txt.mop.com/dzh/centerframe/al2.gif ";
}
*/
leftFrame.centerClick();
}catch (e){}
}
----------------------------这个JS函数就是点击那个图片后触发的函数


他做的那种效果是在左边FRAME加了一个TABLE,然后在靠近frame边框的地方加了一个图片.

------解决方案--------------------
function mainCenterClick(){
try{
if(main.cols!= "6,* ") {
main.cols= "6,* ";

}else{
main.cols= "503,* "

}
leftFrame.centerClick();
}catch (e){}
}

上边的JS有换行,除掉注释的是上边这样的.