$(document).ready(function(){ // first example $("#navigation").treeview({ persist: "location", collapsed: true, unique: true }); // second example $("#browser").treeview(); $("#add").click(function() { var branches = $("
  • New Sublist
  • ").appendTo("#browser"); $("#browser").treeview({ add: branches }); branches = $("
  • New Sublist
  • ").prependTo("#folder21"); $("#browser").treeview({ add: branches }); }); // third example $("#red").treeview({ animated: "fast", collapsed: true, unique: true, persist: "cookie", toggle: function() { window.console && console.log("%o was toggled", this); } }); // fourth example $("#black, #gray").treeview({ control: "#treecontrol", persist: "cookie", cookieId: "treeview-black" }); });