不过有时候在添加删除的时候很麻烦.本人也苦于这样.
嘿嘿本人不喜欢.net的treeview,总感觉静态的导航的话没有什么必要所以写了个树形.
js代码:
1
var list=new Array();
2
list=[["","a0","aa1","target='blank' href='http://baidu.com/s?wd='"],["","a1","aa2","target='blank' href='http://baidu.com'"],["","a2","aa3","target='blank' href='http://baidu.com'"],["a0","2","bb","target='blank' href='http://baidu.com'"],["2","b2","bba","target='blank' href='http://baidu.com'"],["b2","b22","bbaaa","target='blank' href='http://baidu.com'"],["b2","b221","bbaaa","target='blank' href='http://baidu.com'"],["b2","b222","bbaaa","target='blank' href='http://baidu.com'"],["b2","b223","bbaaa","target='blank' href='http://baidu.com'"]];
3
function CreateObjectNode(nodeName,id,className,text)
4
);
2
3
4
使用:
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<title>变色导航栏</title>
6
html>
简单的实现了.2
3
4
5
6
假如配合xml使用那就更好了.
不过这个对于我来说够用了.
贴出来,大家有兴趣的就改吧改吧吧.