日期:2014-05-17  浏览次数:20481 次

刚下载的 ztree3.5 怎么不显示啊
本帖最后由 jiancixiuxian 于 2013-02-27 12:06:02 编辑
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="../../zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.ztree.core-3.5.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script type="text/javascript">

        var setting = {
            data: { simpleData: { enable: true, idkey: "id", pidkey: "pId", rootpid: null} },
            view: {
                selectedMulti: false,
                showLine: true,
                showIcon: false
            }
        };

        var zNodes = [
    { "id": 1, "pId": 0, "name": "test1" },
    { "id": 11, "pId": 1, "name": "test11" },
    { "id": 12, "pId": 1, "name": "test12" },
    { "id": 111, "pId": 11, "name": "test111" }
];
        $(document).ready(function () {

            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
    </script>
</head>
<body>
    <div class="zTreeDemoBackground left">
        <ul id="treeDemo" class="ztree" style="width: 230px; overflow: auto;">
        </ul>
    </div>
    @RenderBody()
</body>
<script>
   
</script>
</html>



求各位  大哥 大姐   教一下
c#?ztree3.5

------解决方案--------------------
你应该把jquery的js文件引用放在ztree.js的前面,不然在执行ztree的时候 会报找不到元素的 
是不是这个情况