addScrollAnim: Add animation on scroll for UI element.

View source: R/anim.R

addScrollAnimR Documentation

Add animation on scroll for UI element.

Description

Add animation on scroll for UI element.

Usage

addScrollAnim(session, id, type = NULL)

Arguments

session

The session object passed to function given to shinyServer.

id

the id of the UI element for which you want animation on scroll.

type

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

See Also

withAnim

Examples

if(interactive()){
library(shiny)
library(shinyanimate)
ui <- fluidPage(
  withAnim(),
    tags$h1('Scroll below to see an animation'),
    br(), br(), br(), br(), br(), br(), br(),
    br(), br(), br(), br(), br(), br(), br(),
    br(), br(), br(), br(), br(), br(), br(),
    br(), br(), br(), br(), br(), br(), br(),
    br(), br(), br(), br(), br(), br(), br(),
    br(), br(), br(), br(), br(), br(), br(),
    tags$div(id = 'title', h1('I ANIMATE ON SCROLL'))
    )
server <- function(input, output, session){
  observe(addScrollAnim(session, 'title', 'bounce'))
 }
shinyApp(ui, server)
}

shinyanimate documentation built on Nov. 2, 2023, 5:53 p.m.