Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created October 13, 2013 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/6967857 to your computer and use it in GitHub Desktop.
Save ramnathv/6967857 to your computer and use it in GitHub Desktop.
Tab Carousel in Shiny
require(shiny)
runApp(list(
ui = pageWithSidebar(
headerPanel("Tab Carousel"),
sidebarPanel(),
mainPanel(
tabsetPanel(id = 'mytab',
tabPanel("Plot", plotOutput("plot")),
tabPanel("Summary", verbatimTextOutput("summary")),
tabPanel("Table", tableOutput("table"))
),
tags$script(HTML("var tabCarousel = setInterval(function() {
var tabs = $('#mytab li'),
active = tabs.filter('.active'),
next = active.next('li'),
toClick = next.length ? next.find('a') : tabs.eq(0).find('a');
toClick.trigger('click');
}, 3000);"))
)
),
server = function(input, output){
}
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment