Skip to content

Instantly share code, notes, and snippets.

@dvl
Created February 28, 2014 04:41
Show Gist options
  • Save dvl/9265372 to your computer and use it in GitHub Desktop.
Save dvl/9265372 to your computer and use it in GitHub Desktop.
jquery fancytree html markup
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JQuery FancyTree</title>
<link href="skin-lion/ui.fancytree.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="tree">
<ul>
<li class="folder expanded">Pastas
<ul>
<li class="folder">1231266</li>
<li class="folder">asdasdsad</li>
<li class="folder">Pasta
<ul>
<li>asd</li>
<li>asd</li>
<li>asdasdas</li>
<li>adasd</li>
<li>asdasdasdasd</li>
</ul>
</li>
<li class="folder">12312</li>
<li class="folder">Pasta Vazia</li>
<li class="folder">Pasta Vazia</li>
<li class="folder">Pasta
<ul>
<li>11111</li>
<li><a href="http://www.google.com/?q=jquery">link</a></li>
<li>Sub</li>
</ul>
</li>
<li class="folder">Pasta Vazia</li>
<li class="folder">Pasta Vazia</li>
<li class="folder">zzzTeste</li>
</ul>
</div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.0/jquery.cookie.min.js"></script>
<script src="jquery.fancytree-all.js"></script>
<script type="text/javascript">
$(function(){
$("#tree").fancytree({
clickFolderMode: 3,
activate: function(e, data) {
var node = data.node;
console.log(node);
if (node.data.href) {
window.open(node.data.href, node.data.target);
}
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment