I used the code for adding overlay animations on tikz-qtree diagrams, suggested by Ignasi (tex.SE answer here). With this code, I can create the following animations:
\documentclass{beamer}
\usepackage{tikz}
\usepackage{tikz-qtree}
\tikzset{% add overlay animations to qtrees
invisible/.style={opacity=0,text opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\Tree
[.\node [visible on=<1->] {Root};
\edge [visible on=<2->];\node [visible on=<2->] {Leaf 1};
\edge [visible on=<3>];\node [visible on=<3>] {Leaf 2};
]
\end{tikzpicture}
\end{frame}
\end{document}
However, I don't know how to modify the code to allow for two arguments to the visible on command to produce something like this:
[visible on=<1,5-6>]
When I add a second (optional) argument to the command, I get an error that says "File ended while scanning use of \pgfkeys@code." How can I modify the code to allow for the optional second argument?