修改了一下数据格式,是json和数组或者混合型的数据都通用,不用特定key等
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://d1.lashouimg.com/static/js/release/jquery-1.4.2.min.js"></script>
<title>JS无级树树形菜单,json格式,数组格式通用</title>
<style type="text/css">
.menuTree
{
margin-left: -30px;
}
.menuTree div
{
padding-left: 30px;
}
.menuTree div ul
{
overflow: hidden;
display: none;
height: auto;
}
.menuTree span
{
display: block;
height: 25px;
line-height: 25px;
padding-left: 5px;
margin: 1px 0;
cursor: pointe