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 slide
  • input$fp_destination: destination slide
  • input$fp_direction: scroll direction

pagePiling & multiScroll

  • input$fp_anchor: slide anchor
  • input$fp_index: slide index

Demo:

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)