Created
October 13, 2013 21:58
-
-
Save ramnathv/6967857 to your computer and use it in GitHub Desktop.
Tab Carousel in Shiny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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