点击隐藏页面左栏或右栏实现js代码
人气:0
点击隐藏页面左栏或右栏(同一TABLE中)
<style type="text/css">
<!--
.navPoint {COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt}
.STYLE1 {FONT-FAMILY: Webdings; FONT-SIZE: 9pt; cursor: hand;}
-->
</style>
<script>
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>
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tr>
<td width="20%" align="middle" vAlign="center" noWrap bgcolor="#CC99FF" id="frmTitle" name="frmTitle"> </td>
<td class=a2 style="WIDTH: 9pt"><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/>
<font color="#FF0000"><br/>
<br/>
<br/>
<br/>
<br/>
<span class="STYLE1" id="switchPoint" title="关闭/打开左栏">3</span><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</font><br/>
<br/>
屏幕切换 </font></td>
</tr>
</table></td>
<td bgcolor="#FFCC99" style="WIDTH: 100%"> </td>
</tr>
</table>
想把隐藏左右栏的那个按钮按成图片,改一下JS,IMG增加ID,这里id=aa,也可以换成其它的名称,参考如下:
<script>
function switchSysBar(){
if (document.all.aa.src.indexOf("bl_1")!=-1){
aa.src="images/al_1.gif"
document.all("frmTitle").style.display="none"
}else{
aa.src="images/bl_1.gif"
document.all("frmTitle").style.display=""
}
}
</script>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="770" valign="top"> </td>
<td width="10" onClick="switchSysBar()"><img id="aa" src="images/bl_1.gif" title="关闭/打开功能导航"></td>
<td width="191" valign="top" id="frmTitle" name="frmTitle"> </td>
</tr>
</table>
复制代码 代码如下:
<style type="text/css">
<!--
.navPoint {COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt}
.STYLE1 {FONT-FAMILY: Webdings; FONT-SIZE: 9pt; cursor: hand;}
-->
</style>
<script>
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>
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tr>
<td width="20%" align="middle" vAlign="center" noWrap bgcolor="#CC99FF" id="frmTitle" name="frmTitle"> </td>
<td class=a2 style="WIDTH: 9pt"><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/>
<font color="#FF0000"><br/>
<br/>
<br/>
<br/>
<br/>
<span class="STYLE1" id="switchPoint" title="关闭/打开左栏">3</span><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</font><br/>
<br/>
屏幕切换 </font></td>
</tr>
</table></td>
<td bgcolor="#FFCC99" style="WIDTH: 100%"> </td>
</tr>
</table>
想把隐藏左右栏的那个按钮按成图片,改一下JS,IMG增加ID,这里id=aa,也可以换成其它的名称,参考如下:
<script>
function switchSysBar(){
if (document.all.aa.src.indexOf("bl_1")!=-1){
aa.src="images/al_1.gif"
document.all("frmTitle").style.display="none"
}else{
aa.src="images/bl_1.gif"
document.all("frmTitle").style.display=""
}
}
</script>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="770" valign="top"> </td>
<td width="10" onClick="switchSysBar()"><img id="aa" src="images/bl_1.gif" title="关闭/打开功能导航"></td>
<td width="191" valign="top" id="frmTitle" name="frmTitle"> </td>
</tr>
</table>
加载全部内容