js實現(xiàn)的折疊導(dǎo)航示例
更新時間:2013年11月29日 17:41:13 作者:
折疊導(dǎo)航的實現(xiàn)方法有很多,在文本為大家介紹下如何使用js實現(xiàn)的折疊導(dǎo)航,感興趣的朋友可以參考下
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8" />
<link href="css/admin.css" type="text/css" rel="stylesheet" />
<script language=javascript>
function expand(el)//傳遞的是id,1,2,3用來區(qū)分所屬的分類
{
childobj = document.getElementById("child" + el);//child1,child2.....
if (childobj.style.display == 'none')//如果此元素師none,就不會被顯示
{
childobj.style.display = 'block';//如果是block。就會顯示為塊級元素
}
else
{
childobj.style.display = 'none';//當(dāng)再次點擊時,那么就會又隱藏起來
}
return;
}
</script>
</head>
<body>
<table height="100%" cellspacing=0 cellpadding=0 width=170
background=./img/menu_bg.jpg border=0>
<tr>
<td valign=top align=middle>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tr>
<td height=10></td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 width=150 border=0>
<tr height=22>
<td style="padding-left: 30px" background=./img/menu_bt.jpg>
<a class=menuparent onclick=expand(1) href="javascript:void(0);">人員管理</a></td></tr>
<tr height=4>
<td></td></tr></table>
<table id=child1 style="display: none" cellspacing=0 cellpadding=0
width=150 border=0>
<tr height=20>
<td align=middle width=30><img height=9
src="./img/menu_icon.gif" width=9></td>
<td><a class=menuchild
href="memberadd.jsp"
target=right>人員增加</a></td></tr>
<tr height=20>
<td align=middle width=30><img height=9
src="./img/menu_icon.gif" width=9></td>
<td><a class=menuchild
href="#"
target=right>人員修改</a></td></tr>
<tr height=20>
<td align=middle width=30><img height=9
src="./img/menu_icon.gif" width=9></td>
<td><a class=menuchild
href="#"
target=right>人員刪除</a></td></tr>
<tr height=20>
<td align=middle width=30><img height=9
src="./img/menu_icon.gif" width=9></td>
<td><a class=menuchild
href="#"
target=right>人員查找</a></td></tr>
<tr height=4>
<td colspan=2></td>
</tr>
</table>
</body>
</html>
相關(guān)文章
JavaScript中的子窗口與父窗口的互相調(diào)用問題
本文給大家介紹了JavaScript中的子窗口與父窗口的互相調(diào)用問題,非常不錯,具有參考借鑒價值,需要的朋友參考下吧2017-02-02JavaScript+Canvas實現(xiàn)酷炫的粒子和流星效果
這篇文章主要為大家詳細(xì)介紹了如何利用JavaScript和Canvas實現(xiàn)酷炫的粒子和流星動畫效果,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2023-01-01javascript eval()應(yīng)用實例 select
javascript eval應(yīng)用小例子。實例代碼就是控制checkbox的選擇與取消的函數(shù),非常不錯。2009-07-07js實現(xiàn)HTML中Select二級聯(lián)動的實例
下面小編就為大家分享一篇js實現(xiàn)HTML中Select二級聯(lián)動的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01uniapp中使用?uni.navigateBack()?返回上級頁面并傳參的方法
最近遇到這樣的需求在A頁面中通過跳轉(zhuǎn)到B頁面,在B頁面中處理的數(shù)據(jù),需要跳轉(zhuǎn)回A頁面供其使用,本文給大家分享uniapp中使用?uni.navigateBack()?返回上級頁面并傳參的操作方法,感興趣的朋友一起看看吧2023-10-10WordPress 單頁面上一頁下一頁的實現(xiàn)方法【附代碼】
下面小編就為大家?guī)硪黄猈ordPress 單頁面上一頁下一頁的實現(xiàn)方法【附代碼】。小編覺得非常不錯。給大家分享一下。希望能給大家一個參考。2016-03-03