library(shiny)
library(shinyGizmo)
ui <- fluidPage(
actionButton("value", "Click me", class = "btn-primary"),
br(), br(),
conditionalJS(
tags$h1("Hello", style = "display: none;"),
"input.value % 2 === 1",
jsCalls$custom(
true = runAnimation(animation("jello"), animation("swing")),
false = runAnimation(animation("slideOutRight"))
)
)
)
server <- function(input, output, session) {}
if(interactive()) {
shinyApp(ui, server)
}
Run the code above in your browser using DataLab