startAnim: Start an animation

View source: R/anim.R

startAnimR Documentation

Start an animation

Description

Start an animation of the UI element.

Usage

startAnim(session, id, type = NULL, delay = NULL)

Arguments

session

The session object passed to function given to shinyServer.

id

the id of the UI element for which you want to add animation.

type

The type of animation to use, valid values correspond to the types in https://daneden.github.io/animate.css/

delay

The time after which you want to add animationin milliseconds

See Also

withAnim

Examples

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)
}

Swechhya/shinyanimate documentation built on Feb. 17, 2024, 1:50 p.m.