0

这是我的文件 omploader.org/vNWJieg/1.png:

这是我的代码:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>jsTree v.1.0 - full featured demo</title>
 <script type="text/javascript" src="_lib/jquery.js"></script>
 <script type="text/javascript" src="_lib/jquery.cookie.js"></script>
 <script type="text/javascript" src="_lib/jquery.hotkeys.js"></script>
 <script type="text/javascript" src="jquery.jstree.js"></script>
 <link rel="stylesheet" type="text/css" href="_docs/!style.css" />
 <style type="text/css">
 html, body { margin:0; padding:0; }
 body, td, th, pre, code, select, option, input, textarea { font-family:verdana,arial,sans-serif; font-size:10px; }
 .demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
 #container { width:780px; margin:10px auto; overflow:hidden; position:relative; }
 #demo { width:auto; height:400px; overflow:auto; border:1px solid gray; }

 #text { margin-top:1px; }

 #alog { font-size:9px !important; margin:5px; border:1px solid silver; }
 </style>
</head>
<body>
<div id="demo1">
 <a href="some_value_here">Node title</a>
 <ul>
  <li>
   saaa
   <!-- UL node only needed for children - omit if there are no children -->
   <ul>
    <li>aaa</li>
    <li>sss</li>
   </ul>
  </li>
 </ul>

</div>
<script type="text/javascript">
 $(function () {
 $("#demo1").jstree({ 
  "themes": {
         "theme": "default",
         "dots": true,
         "icons": true,
         "url": "themes/default/style.css"
       },
  "plugins" : [ "themes", "html_data" ]
 });
});
</script>
</body>
</html>

我的结果是 omploader.org/vNWJibg :

你可以看到,它没有任何主题,

那么如何让它工作,

谢谢

更新:

这是我的结果图片:omploader.org/vNWJjbQ/1.png

如何让它工作。

更新2

哦,我知道了,它一定是<a>元素中的<li>

这是我的代码:

<div id="demo1">
    <ul>
        <li>
            <a href="">aaa</a>
            <!-- UL node only needed for children - omit if there are no children -->
            <ul>
                <li><a href=""> kkk</a></li>
                <li><a href=""> kkk</a></li>
            </ul>
        </li>
    </ul>

</div>
4

1 回答 1

2

看起来您的 div 上没有 ID。更改<div id=""><div id="demo1">

于 2010-08-23T17:47:06.407 回答