Start an animation of the UI element.
startAnim(session, id, type = NULL, delay = NULL)
The session object passed to function given to shinyServer.
the id of the UI element for which you want to add animation.
The type of animation to use, valid values correspond to the types in https://daneden.github.io/animate.css/
The time after which you want to add animationin milliseconds
if(interactive()){
library(shiny)
library(shinyanimate)
ui <- fluidPage(
withAnim(),
tags$div(id = 'title', h1('ANIMATION')),
actionButton(inputId = "button", label = "Animate")
)
server <- function(input, output, session){
observeEvent(input$button,{
startAnim(session, 'title', 'bounce')
})
}
shinyApp(ui, server)
}