框架集的折叠
来源:互联网 发布:频域滤波 python 编辑:程序博客网 时间:2024/05/01 20:51
主框架mainFrame分成三个子框架,分别为leftFrame,rightFrame,topFrame,框架集代码如下:隐藏leftFrame代码如下:要注意的关键点:在主框架中设置标签frameset的id=leftFrame,在script脚本中改变的是主框架id为leftFrame的cols属性,而不是frame标签下的子框架名.
<frameset rows="40,*" cols="*" frameborder="no" border="1" framespacing="0">
<frame src="top.aspx" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="160px,*" frameborder="no" border="1" framespacing="0" id="leftFrame">
<frame src="left.aspx" scrolling="No" noresize="noresize" />
<frame src="right.aspx" noresize=noresize/>
</frameset>
</frameset>
<frame src="top.aspx" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="160px,*" frameborder="no" border="1" framespacing="0" id="leftFrame">
<frame src="left.aspx" scrolling="No" noresize="noresize" />
<frame src="right.aspx" noresize=noresize/>
</frameset>
</frameset>
在topFrame中添加一个图标用来显示和隐藏leftFrame或是rightFrame,隐藏rightFrame代码如下:
<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="top.aspx.cs" Inherits="top" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<script language="javascript">...
function Show_Hide_Menu()...{
if(window.parent.leftFrame.cols=="160,*,0,0,0")...{
document.getElementById("menuICON").src="../image/Image00010.jpg";
document.getElementById("menuICON").alt="隐藏菜单"
window.parent.leftFrame.cols="*,0,0,0,0";
}
else...{
document.getElementById("menuICON").src="../image/Image00009.jpg";
document.getElementById("menuICON").alt="显示菜单"
window.parent.leftFrame.cols="160,*,0,0,0";
}
}
</script>
<body link="#66ff00" style="background-color: green">
<form id="form1" runat="server">
<div style="background-color: black">
<img style="cursor:hand; width: 81px; height: 46px;" src="../image/Image00009.jpg" alt="隐藏菜单" onclick="javascript:Show_Hide_Menu();" id="menuICON" />
</div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<script language="javascript">...
function Show_Hide_Menu()...{
if(window.parent.leftFrame.cols=="160,*,0,0,0")...{
document.getElementById("menuICON").src="../image/Image00010.jpg";
document.getElementById("menuICON").alt="隐藏菜单"
window.parent.leftFrame.cols="*,0,0,0,0";
}
else...{
document.getElementById("menuICON").src="../image/Image00009.jpg";
document.getElementById("menuICON").alt="显示菜单"
window.parent.leftFrame.cols="160,*,0,0,0";
}
}
</script>
<body link="#66ff00" style="background-color: green">
<form id="form1" runat="server">
<div style="background-color: black">
<img style="cursor:hand; width: 81px; height: 46px;" src="../image/Image00009.jpg" alt="隐藏菜单" onclick="javascript:Show_Hide_Menu();" id="menuICON" />
</div>
</form>
</body>
</html>
<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="right.aspx.cs" Inherits="right" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<script language="javascript">...
function Show_Hide_Menu()...{
if(window.parent.leftFrame.cols=="160,*,0,0,0")...{
document.getElementById("menuICON").src="../image/Image00010.jpg";
document.getElementById("menuICON").alt="隐藏菜单"
window.parent.leftFrame.cols="0,*,0,0,0";
}
else...{
document.getElementById("menuICON").src="../image/Image00009.jpg";
document.getElementById("menuICON").alt="显示菜单"
window.parent.leftFrame.cols="160,*,0,0,0";
}
}
</script>
<body style="background-color: fuchsia">
<form id="form1" runat="server">
<img style="cursor:hand; width: 81px; height: 46px;" src="../image/Image00009.jpg" alt="隐藏菜单" onclick="javascript:Show_Hide_Menu();" id="menuICON" />
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<script language="javascript">...
function Show_Hide_Menu()...{
if(window.parent.leftFrame.cols=="160,*,0,0,0")...{
document.getElementById("menuICON").src="../image/Image00010.jpg";
document.getElementById("menuICON").alt="隐藏菜单"
window.parent.leftFrame.cols="0,*,0,0,0";
}
else...{
document.getElementById("menuICON").src="../image/Image00009.jpg";
document.getElementById("menuICON").alt="显示菜单"
window.parent.leftFrame.cols="160,*,0,0,0";
}
}
</script>
<body style="background-color: fuchsia">
<form id="form1" runat="server">
<img style="cursor:hand; width: 81px; height: 46px;" src="../image/Image00009.jpg" alt="隐藏菜单" onclick="javascript:Show_Hide_Menu();" id="menuICON" />
</form>
</body>
</html>
- 框架集的折叠
- 左边框架的折叠显示
- html框架折叠的javascript实现
- 三栏式折叠框架
- iOS干货:快速集成tableView折叠cell的小框架
- 折叠margin 折叠margin的消除
- 粒子效果与酷炫的二维码生成与折叠的layout的三个框架
- 菜单折叠的实现
- vim 折叠的用法
- ASPxNavBar的折叠展开
- UITableView的折叠效果
- vim的代码折叠
- vim的折叠功能
- 折叠分组的DataGrid
- 常量折叠的理解
- margin折叠的问题
- UITableView 的折叠状态
- UITableView的折叠效果
- 设计模式(八)[工厂方法(Factory Method)模式]
- QuickTime Component实例(一)
- QuickTime Component实例(二)
- 微软发布6月份安全更新程序补丁(For Windows xp/2003/2000/vista和Office 2003/2007所有更新产品补丁)
- showModalDialog和showModelessDialog使用心得
- 框架集的折叠
- asp.net 应用程序和服务已经锁定
- JavaOne 2007:Sun 在客户端的回归
- 未公开的mustang核心秘密(二):jni的返回中文问题
- 追逐日光(Chasing Daylight)——请多给亲人朋友和自己点时间
- C#里的委托和事件实现Observer
- Mutex 和 Critical Section 的异同
- 转帖 提高asp.net性能的十大技巧
- 评论专栏: David Konopnicki:搜索技术已经发生了改变,您是否跟上了它的发展呢?