Skip to content

Instantly share code, notes, and snippets.

@iancoffey
Created February 6, 2012 20:46
Show Gist options
  • Save iancoffey/1754733 to your computer and use it in GitHub Desktop.
Save iancoffey/1754733 to your computer and use it in GitHub Desktop.
JS
<script>
$(function() {
$(".tree_node").click(function(e) {
e.preventDefault();
id = $(this).attr("id");
vis = $("#details_" + id).is(":visible");
$(this).toggleClass("tree_closed",vis);
$(this).toggleClass("tree_open",!vis);
$("#details_" + id).toggle(!vis);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment