Create a full scrolling page.
pagePiling(..., sections.color, opts = list(), menu = NULL, center = FALSE)
... | any element. |
---|---|
sections.color | character vector, i.e.: |
opts | list of options, see details. |
menu | menu links as named vector. |
center | horizontally center all sections. |
direction
- takes vertical
or horizontal
- defines if the scroll is vertical or horizontal.
verticalCentered
- boolean.
scrollingSpeed
- scrolling transitions in milliseconds, numeric value i.e.: 700
.
easing
- character string - takes swing
or linear
.
loopBottom
- boolean - defines whether scrolling down in the last section should scroll to the first one or not.
loopTop
- boolean - defines whether scrolling up in the first section should scroll to the last one or not.
css3
- boolean - defines whether to use JavaScript or CSS3 transforms to scroll within sections. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.
navigation
- boolean - if set, it will show a navigation bar made up of small circles.
touchSensitivity
- numeric value - defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section.
keyboardScrolling
- boolean - defines if the content can be navigated using the keyboard.
animateAnchor
- boolean - defines whether the load of the site when given an anchor will scroll with animation to its destination or will directly load on the given section.
if(interactive()){ # Run de demo demo("pagePiling", package = "fullPage") # Or library(shiny) options <- list( loopBottom = TRUE ) ui <- pagePiling( center = TRUE, sections.color = c('#f2f2f2', '#2C3E50', '#39C'), opts = options, menu = c("Section 1" = "section1", "Piling" = "section2", "Plots" = "section3", "Reactive" = "section4", "Images" = "images"), pageSection( menu = "section1", h1("Page piling") ), pageSection( menu = "section2", h1("Section 2") ), pageSectionPlot( "plot", menu = "section3", h1("Plot background") ), pageSectionPlot( "plot2", menu = "section4", pageContainer( h1("Reactive background"), sliderInput( "bins", "Data Points", min = 100, max = 500, step = 25, value = 200 ) ) ), pageSectionImage( # will not show in viewer, open in browser menu = "image", img = paste0( "https://raw.githubusercontent.com/alvarotrigo/", "fullPage.js/master/examples/imgs/bg2.jpg"), h1("Image background") ) ) server <- function(input, output){ output$plot <- renderPlot({ par(bg = "grey60") plot(mtcars$wt, mtcars$mpg) }) output$plot2 <- renderPlot({ par(bg = "grey80") hist(rnorm(input$bins, 100, 250)) }) } shinyApp(ui, server) }