jquery 树形菜单,但是页面一加载它默认全都展开了,有没有语句让它加载时全都收起,点击再展开 10
2011-07-29
展开全部
<html>
<head>
<title>测试</title>
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="JS/dtree.js"></script>
</head>
<body leftMargin='20'>
<div class="dtree">
<script type="text/javascript">
<!--
//id, pid, name, url, title, target, icon, iconOPne, open,
d = new dTree('d');
d.config.target="right";
d.config.folderLinks = false;
d.add(0,-1,'<B>父目录</B>');
d.add(1,0,'子目录1');
d.add(100,1,'Overview','Overview.html','Introduction to FusionCharts');
d.add(6,0,'子目录2','');
d.add(250,6,'AAA','');
d.add(269,6,'BBB','');
d.add(300,6,'CCC','');
d.add(309,6,'DDD','');
d.add(810,6,'EEEs','');
d.add(2,0,'其他');
document.write(d);
//-->
</script>
<p><a href="javascript: d.openAll();">Expand all</a> | <a href="javascript:d.closeAll();">Collapse all</a></p>
</div>
</body>
</html>
把
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="JS/dtree.js"></script>
换成你自己的目录 就好了
<head>
<title>测试</title>
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="JS/dtree.js"></script>
</head>
<body leftMargin='20'>
<div class="dtree">
<script type="text/javascript">
<!--
//id, pid, name, url, title, target, icon, iconOPne, open,
d = new dTree('d');
d.config.target="right";
d.config.folderLinks = false;
d.add(0,-1,'<B>父目录</B>');
d.add(1,0,'子目录1');
d.add(100,1,'Overview','Overview.html','Introduction to FusionCharts');
d.add(6,0,'子目录2','');
d.add(250,6,'AAA','');
d.add(269,6,'BBB','');
d.add(300,6,'CCC','');
d.add(309,6,'DDD','');
d.add(810,6,'EEEs','');
d.add(2,0,'其他');
document.write(d);
//-->
</script>
<p><a href="javascript: d.openAll();">Expand all</a> | <a href="javascript:d.closeAll();">Collapse all</a></p>
</div>
</body>
</html>
把
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="JS/dtree.js"></script>
换成你自己的目录 就好了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
建议你看下锋利的jquery里面有关于树形菜单类似的实例
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询