?? menu.htm.bak
字號(hào):
<html>
<titile></title>
<body>
<table border="0" id="rootNode" style="font-size:9pt;" cellspacing=0 cellpadding=0>
<TBODY>
<SCRIPT src="alai_tree.js"></SCRIPT>
<SCRIPT src="alai_tree_win2k.js"></SCRIPT>
創(chuàng)建目錄樹的示例程序:
<SCRIPT>
var myTree=new alai_tree_win2k() //用模板程序建樹
var root=myTree.root //根節(jié)點(diǎn)的引用
//添加目錄樹節(jié)點(diǎn)
var n1=root.add("文檔中心")
n1.addLink("doc1.htm",".NET")
n1.addLink("doc2.htm","C++")
n1.addLink("doc3.htm","數(shù)據(jù)庫")
n1.addLink("doc4.htm","Delphi")
with(root.add("新聞中心"))
{
addLink("new1.htm","國(guó)內(nèi)")
addLink("new2.htm","國(guó)際")
addLink("new3.htm","IT新聞")
}
</SCRIPT>
<script language="javascript">
// 創(chuàng)建樹的根結(jié)點(diǎn),以后就可以在該根結(jié)點(diǎn)下創(chuàng)建子樹及葉子
var treeRoot = new tree("rootNode");
var tb;
tb = new treeBranch( "第一個(gè)子樹" // 子樹顯示的文字
,"../images/timebook_evection.gif" // 子樹展開時(shí)的圖標(biāo)
,"../images/timebook_evection.gif" // 子樹收縮時(shí)的圖標(biāo)
,null //附加到子樹的數(shù)據(jù),以后可通過tb.data進(jìn)行訪問
,"if(this.opened){alert('子樹展開');}else{alert('子樹收縮');}" // 當(dāng)子樹展開或收縮時(shí)將調(diào)用的代碼
,"alert('子樹被選中!');" // 當(dāng)子樹的文本標(biāo)簽被選中時(shí)將調(diào)用的代碼
);
tb.tdMouseOver = "treeBranchMouseOver"; // 當(dāng)鼠標(biāo)移上時(shí)子樹的樣式類名稱
tb.tdMouseOut = "treeBranchMouseOut"; // 當(dāng)鼠標(biāo)移開時(shí)子樹的樣式類名稱
tb.spanMouseOver = "treeBranchMouseOver"; //當(dāng)鼠標(biāo)移上時(shí)子樹文本標(biāo)簽的樣式類名稱
tb.spanMouseOut = "treeBranchMouseOut"; //當(dāng)鼠標(biāo)移開時(shí)子樹文本標(biāo)簽的樣式類名稱
tb.spanSelected = "treeBranchSelected"; // 當(dāng)子樹處于選中狀態(tài)時(shí)的樣式類名稱
// 往根節(jié)點(diǎn)添加剛才創(chuàng)建的子樹,第一個(gè)參數(shù)是將要插入的位置
var t = treeRoot.addBranch(treeRoot.length() , tb); // 返回參數(shù) t 為被插入的子樹
var tn = t.addNode(t.length() // 將插入的葉子的位置
, "子結(jié)點(diǎn)顯示名稱" // 葉子文本標(biāo)簽文字
, "../images/spacer.gif" // 葉子的顯示圖標(biāo)
, "../images/spacer.gif" // 當(dāng)葉子被選中時(shí)將顯示的圖標(biāo)
, null // 附加到葉子結(jié)點(diǎn)的數(shù)據(jù),以后的代碼可以通過 tn.data 訪問該數(shù)據(jù)
, "alert('葉子被點(diǎn)中!');" // 當(dāng)葉子被點(diǎn)擊時(shí)將調(diào)用的代碼
);
tn.setClass("disabled"); //設(shè)置葉子的樣式類名稱
</script>
</TBODY>
</table>
<body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -