Setting up a jstree based on a html list
I'm new to both jQuery and jsTree and haven't much experience with html,
CSS or Java Script either. Now, I'm trying to set up a little test tree in
html list format. This is my html list:
<div id="testtree">
<ul>
<li><a>Fruits and Vegetables</a>
<ul>
<li><a>Fruit</a>
<ul>
<li><a>Apple</a></li>
<li><a>Banana</a></li>
</ul>
</li>
<li><a>Vegetables</a>
<ul>
<li><a>Zucchini</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
This is my code:
<!doctype html>
<html>
<head>
<title>jstree test</title>
</head>
<body>
<script type="text/javascript" src="_lib/jquery.js"></script>
<script type="text/javascript" src="jquery.jstree.js"></script>
</body>
</html>
Now I'm not sure where to insert the html list into the code and where to
insert
$("#testtree").jstree();
I put all the jsTree files in the same folder as my html file (including
_demo, _docs and _lib), not only the jquery.jstree.js file. The jQuery
file that was included in the installation package of jsTree is working -
I'm not sure if my code is wrong or if it's a problem with the
jquery.jstree.js file. Any ideas as to what I'm doing wrong would be much
appreciated!
No comments:
Post a Comment