欢迎来到代码驿站!

JavaScript代码

当前位置:首页 > 网页前端 > JavaScript代码

点击隐藏页面左栏或右栏实现js代码

时间:2021-04-04 10:16:22|栏目:JavaScript代码|点击:
点击隐藏页面左栏或右栏(同一TABLE中)
复制代码 代码如下:

<style type="text/css">
<!--
.navPoint &#123;COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt&#125;
.STYLE1 &#123;FONT-FAMILY: Webdings; FONT-SIZE: 9pt; cursor: hand;&#125;
-->
</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">&nbsp;</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">&nbsp;</td>
</tr>
</table>

上一篇:js实现上传并压缩图片效果

栏    目:JavaScript代码

下一篇:离开当前页面前使用js判断条件提示是否要离开页面

本文标题:点击隐藏页面左栏或右栏实现js代码

本文地址:http://www.codeinn.net/misctech/94544.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有