Callbacks let you pick up on events, i.e.: which slide is currently being viewed. For instance, it comes in handy to display animations at the right moment! Below are the callbacks available to each family of functions:
fullPage
input$fp_origin
: origin slideinput$fp_destination
: destination slideinput$fp_direction
: scroll directionpagePiling & multiScroll
input$fp_anchor
: slide anchorinput$fp_index
: slide indexDemo:
library(shiny)
library(fullPage)
ui <- fullPage(
fullSection(
menu = "first",
center = TRUE,
h1("Callbacks")
),
fullSection(
menu = "second",
center = TRUE,
h3("Slide"),
verbatimTextOutput("slide")
)
)
server <- function(input, output){
output$slide <- renderPrint({
input$fp_origin # returns menu
})
}
shinyApp(ui, server)