<script>
var p=0
function switchSysBar(){
if (p==0){
switchPoint.innerHTML=">"
document.all("frmTitle").style.display="none"
p=1
}
else{
switchPoint.innerHTML="<"
document.all("frmTitle").style.display=""
p=0
}
}
</script>
</head>
<body style="MARGIN: 0px" scroll=no>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td id="frmTitle" name="frmTitle" nowrap valign="middle" align="center" width="180">
<IFRAME id="BoardTitle" name="main" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 180; Z-INDEX: 2" scrolling="no" frameborder="0" src="FuncBar.asp"></IFRAME>
<td style="width:10pt" bgcolor="#ffcc11">
<table cellspacing="0" cellpadding="0" border="0" height="100%">
<tr>
<td style="height:100%" onClick="switchSysBar()">
<span id="switchPoint" title="0112121" bgcolor=red><</font></span>
</table>
</td>
<td style="width:100%">
<IFRAME id="frmright" name="BoardList" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1" scrolling="auto" frameborder="0" src="main.asp"></IFRAME>
</tr>
</table>
var p=0
function switchSysBar(){
if (p==0){
switchPoint.innerHTML=">"
document.all("frmTitle").style.display="none"
p=1
}
else{
switchPoint.innerHTML="<"
document.all("frmTitle").style.display=""
p=0
}
}
</script>
</head>
<body style="MARGIN: 0px" scroll=no>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td id="frmTitle" name="frmTitle" nowrap valign="middle" align="center" width="180">
<IFRAME id="BoardTitle" name="main" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 180; Z-INDEX: 2" scrolling="no" frameborder="0" src="FuncBar.asp"></IFRAME>
<td style="width:10pt" bgcolor="#ffcc11">
<table cellspacing="0" cellpadding="0" border="0" height="100%">
<tr>
<td style="height:100%" onClick="switchSysBar()">
<span id="switchPoint" title="0112121" bgcolor=red><</font></span>
</table>
</td>
<td style="width:100%">
<IFRAME id="frmright" name="BoardList" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1" scrolling="auto" frameborder="0" src="main.asp"></IFRAME>
</tr>
</table>
可是我在iframe里面放表格为什么不行呢!?
谢谢
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function $(elementId)
{
return document.getElementById(elementId);
}
</script>
</head>
<body>
<table>
<tr>
<td id="leftTd" style="width: 300px; height: 21px; background-color: #ff0000;">
</td>
<td style="width: 30px; height: 21px">
<input id="Button1" type="button" value="向左走,向右走" onclick="buttonClick()" /></td>
<td id="rightTd" style="width: 300px; height: 21px; background-color: #0000ff;">
</td>
</tr>
</table></body>
</html>
<script type="text/javascript">
var leftTd = $("leftTd");
var rightTd = $("rightTd");
var Button2 = $("Button2");
var plusTd = rightTd;
var subTd = leftTd;
var leftOrRight = true; // true is left, flase is right
var timer = false;
var offset = 1;
// 按钮的单击处理事件
function buttonClick()
{
// 根据不同的状态值来设定加和减对象
if(leftOrRight)
{
plusTd = rightTd;
subTd = leftTd;
}
else
{
plusTd = leftTd;
subTd = rightTd;
}
offset = 0.1;
// 启动定时期,开始移动
timer = window.setTimeout(move,10);
}
// 移动
function move()
{
// 取得减少一方现在的宽度
var width = parseInt(subTd.style.width);
// 判断是否继续移动
if(width > 0)
{
// 继续移动
// 取得要位移的差值
offset = offset + offset/5;
if(offset > width) offset = width;
var offsetNow = Math.ceil(offset);
// 位移
subTd.style.width = parseInt(subTd.style.width) - offsetNow;
plusTd.style.width = parseInt(plusTd.style.width) + offsetNow;
// 继续移动
timer = window.setTimeout(move,10);
}
else
{
leftOrRight = !leftOrRight;
}
}
//
</script>
<script>
function s()
{
if(h.style.display!="none")
{
h.style.display="none";
info.innerHTML="6";
h.style.left=200;
}
else
{
h.style.display="";
info.innerHTML="9";
}
}</script>
<table width="100%">
<tr>
<td bgcolor="red">
<a href="javascript:s()">点这里</a>
<div onClick="s()" id="info" style="CURSOR:hand;position:absolute">ffff</div>
</td>
<td width="220" bgcolor="#000000" id="h"></td>
</tr>
</table>
非常感谢你回复我的帖子,我想需要一份,请发给我好吗?谢谢。我帖子的地址:
http://community.csdn.net/Expert/topic/4874/4874735.xml?temp=.2125513
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}
}
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tr>
<td align="middle" noWrap vAlign="center" id="frmTitle">
<iframe frameBorder="0" id="carnoc" name="carnoc" scrolling="no" src="left.asp" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 170px; Z-INDEX: 2">
</iframe>
</td>
<td style="WIDTH: 9pt" class=a2>
<table border="0" cellPadding="0" cellSpacing="0" height="100%">
<tr>
<td style="HEIGHT: 100%" onclick="switchSysBar()">
<font style="FONT-SIZE: 9pt; CURSOR: default; COLOR: #ffffff">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<span class="navPoint" id="switchPoint" title="关闭/打开左栏">3</span><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
屏幕切换 </font></td>
</tr>
</table>
</td>
<td style="WIDTH: 100%">
<iframe frameBorder="0" id="main" name="main" scrolling="yes" src="Default.asp" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1">
</iframe> </td>
</tr>
</table>
新建一母版页MasterPage.master,做好你的布局后,在新建一aspx页test.aspx,在test.aspx中的代码如下:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphLeft" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="chpMain" Runat="Server">
</asp:Content>
<html><head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>3 屏幕切换</title>
<script language="javascript">
function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}
}
</script>
</head><body><table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tr>
<td align="middle" noWrap vAlign="center" id="frmTitle">
<iframe frameBorder="0" id="carnoc" name="carnoc" scrolling="no" src="left.htm" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 170px; Z-INDEX: 2">
</iframe>
</td>
<td style="WIDTH: 9pt" class=a2>
<table border="0" cellPadding="0" cellSpacing="0" height="100%">
<tr>
<td style="HEIGHT: 100%" onclick="switchSysBar()">
<font style="FONT-SIZE: 9pt; CURSOR: default; COLOR: #ffffff">
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<span class="navPoint" id="switchPoint" title="关闭/打开左栏">3</span><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
屏幕切换 </font></td>
</tr>
</table>
</td>
<td style="WIDTH: 100%">
<iframe frameBorder="0" id="main" name="main" scrolling="yes" src="default.htm" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1">
</iframe> </td>
</tr>
</table></body></html>