#' @importFrom shiny callModule
#' @importFrom shinyjs onclick runjs
app_server <- function(input, output, session) {
onclick('btn-header-plats',
function(){
callModule(mod_covid_server, "covid_ui_1")
runjs("
document.getElementById('header-menu').querySelector('#btn-header-home').classList.remove('active');
document.getElementById('btn-header-plats').classList.add('active');
")
})
onclick('btn-header-home',
function(){
runjs("
document.getElementById('header-menu').querySelector('#btn-header-plats').classList.remove('active');
document.getElementById('btn-header-home').classList.add('active');
")
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.