Description Usage Arguments See Also Examples
activate will set an element as active or inactive.
html_set_active will make an element active.
html_set_inactive will hide an element inactive.
1 2 3 4 5  | activate(id, state)
html_set_active(id)
html_set_inactive(id)
 | 
id | 
 shiny input id  | 
state | 
 logical scalar. If state is   | 
Other javascript functions: ability,
click_event, html_class,
html_toogle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  | library(shinytools)
if (interactive()) {
  options(device.ask.default = FALSE)
  ui <- fluidPage(
    titlePanel("Hello dghiesse!"),
    load_jstools(),
    sidebarLayout(
      sidebarPanel(
        actionButton("activate", "activate"),
        actionButton("inactivate", "inactivate")
      ),
      mainPanel(
        actionButton("anybutton", "watch this button", class = "btn-info")
      )
    )
  )
  server <- function(input, output) {
    observeEvent(input$activate, {
      html_set_active("anybutton")
    })
    observeEvent(input$inactivate, {
      html_set_inactive("anybutton")
    })
  }
  print(shinyApp(ui, server))
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.