问题描述
我在下面有一个闪亮的仪表板,我在侧边栏和标题中做了一些调整。我想知道是否可以停用当用户将鼠标悬停在标题上时使标题颜色“更粗”的功能。
library(shiny)
library(shinydashboard)
library(shinydashboardplus)
library(shinyjs)
mytitle <- paste0("Life,Death & Statins")
dbHeader <- dashboardHeaderPlus(
titleWidth = "0px",tags$li(a(
div(style = "margin-left:-15px;margin-bottom:-83px;margin-top:-15px;padding: 0px 1190px 0px 0px ; width: 290px;",img(src = 'download.png',height = "125px",width="232px")),div(style="display: inline;margin-top:-35px; padding: 0px 90px 0px 1250px ;font-size: 58px ;color: black;font-family:Times-New Roman;font-weight: bold; width: 500px;",HTML(mytitle))
),class = "dropdown")
)
shinyApp(
ui = dashboardPagePlus(
header = dbHeader,sidebar = dashboardSidebar(width = "0px",sidebarMenu(id = "sidebar" # id important for updateTabItems
) ),body = dashboardBody(
useShinyjs(),tags$script(HTML("$('body').addClass('fixed');")),tags$head(tags$style(".skin-blue .main-header .logo { padding: 0px;}")),tags$head(tags$style(HTML('
/* logo */
.skin-blue .main-header .logo {
background-color: #faf0e6;
}
/* logo when hovered */
.skin-blue .main-header .logo:hover {
background-color: #faf0e6;
}
/* navbar (rest of the header) */
.skin-blue .main-header .navbar {
background-color: #faf0e6;
}
/* body */
.content-wrapper,.right-side {
background-color: #faf0e6;
}
'))),tags$head(tags$style(".skin-blue .main-header .navbar:hover {background-color:#faf0e6 ;}"))
)
),server<-shinyServer(function(input,output,session) {
hide(selector = "body > div > header > nav > a")
}
)
)
解决方法
您可以通过以下方式控制它:
tags$head(tags$style(".skin-blue .main-header .navbar:hover {background-color: orange;}"))