點擊隱藏頁面左欄或右欄實現(xiàn)js代碼
更新時間:2013年04月01日 16:03:48 作者:
通過點擊來隱藏頁面左欄或右欄,此效果在實際應(yīng)用中很常見,接下來為大家詳細(xì)介紹下實現(xiàn)代碼,感興趣的朋友可以參考下哈,希望可以幫助到你
點擊隱藏頁面左欄或右欄(同一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="關(guān)閉/打開左欄">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="關(guān)閉/打開功能導(dǎo)航"></td>
<td width="191" valign="top" id="frmTitle" name="frmTitle"> </td>
</tr>
</table>
復(fù)制代碼 代碼如下:
<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="關(guān)閉/打開左欄">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="關(guān)閉/打開功能導(dǎo)航"></td>
<td width="191" valign="top" id="frmTitle" name="frmTitle"> </td>
</tr>
</table>
您可能感興趣的文章:
相關(guān)文章
Bootstrap Table服務(wù)器分頁與在線編輯應(yīng)用總結(jié)
這篇文章主要介紹了Bootstrap Table服務(wù)器分頁與在線編輯應(yīng)用總結(jié) 的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-08-08淺談js停止事件冒泡 阻止瀏覽器的默認(rèn)行為(阻止超連接 #)
下面小編就為大家?guī)硪黄獪\談js停止事件冒泡 阻止瀏覽器的默認(rèn)行為(阻止超連接 #)。2017-02-02ionic實現(xiàn)下拉刷新載入數(shù)據(jù)功能
這篇文章主要為大家詳細(xì)介紹了ionic實現(xiàn)下拉刷新載入數(shù)據(jù)功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-05-05詳解js根據(jù)百度地圖提供經(jīng)緯度計算兩點距離
這篇文章主要介紹了js根據(jù)百度地圖提供經(jīng)緯度計算兩點距離,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05BOM系列第一篇之定時器setTimeout和setInterval
這篇文章主要介紹了BOM系列第一篇之定時器setTimeout和setInterval 的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-08-08js將URL網(wǎng)址轉(zhuǎn)為16進制加密與解密函數(shù)
這篇文章主要介紹了js將URL網(wǎng)址轉(zhuǎn)為16進制加密與解密函數(shù),很多朋友喜歡將網(wǎng)址轉(zhuǎn)換為16進制,網(wǎng)上實在找不到轉(zhuǎn)換為\x這樣的工具,于是手工改一下2020-03-03