[Tex/LaTex] Animation with Beamer

animationsbeameroverlays

I am preparing a presentation with Beamer where I am trying to use text overlays. My working example is as follows:

 \documentclass{beamer}
  \begin{document}
   \begin{frame}{Test}
    Animation with beamer \only<4>{:learn}
    \begin{itemize}[<+(1)- | alert@+>]
     \item First item, uncovered on second slide
      \item Second item, uncovered on third slide. 
       \pause
     \item Third item
      \item Fourth item
      \end{itemize}
      \end{frame}
   \end{document}

In this example, I want the third item to start at the position of the first, i.e., the first one is replaced with the third, second by fourth and so on, such that it looks the following way:

Animation with beamer

  1. First item, uncovered on second slide

  2. Second item, uncovered on third slide

After this is over, the next slide should start

Animation with beamer: learn

  1. Third item

  2. Fourth item

This example does not work the way I want. Please help and suggest.

Best Answer

Would additional \only solve your problem?

\documentclass{beamer}
\begin{document}
    \begin{frame}{Test}
    Animation with beamer \only<4-5>{:learn}
        \begin{itemize}[<+(1)- | alert@+>]
            \only<1-3>{
                \item First item, uncovered on second slide
                \item Second item, uncovered on third slide. 
            }
            \item<4-5> Third item
            \item<5> Fourth item
        \end{itemize}
    \end{frame}
\end{document}