我的 R Shiny 应用程序中有一个绝对面板,我正在尝试根据鼠标悬停操作更改其不透明度。如果光标在面板上,则不透明度将为 1 或 0.5
我尝试了下面的代码,但无论鼠标悬停操作如何,它都会使面板透明
fluidPage(
tags$head(tags$style(
HTML('
#input_date_control {opacity : 0.65;}
#sel_date {opacity: 1;}')
)),
absolutePanel(id = "input_date_control", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
width = 230, height = 213,
box(title = 'Selector', width = 11.5, status = 'primary', solidHeader = TRUE,
tags$head(
tags$style(
".selectize-dropdown, .selectize-input, .selectize-input {
line-height: 10px;
}"
)),
selectizeInput("disease", label = "Select disease('s)",
choices = unique(salmonella_all$Disease), multiple = T,
options = list(maxItems = 12, placeholder = 'Select a disease'),
selected = "Chlamydia"),
dateRangeInput("daterange", "Select date range:",
start = "2014-01-07",
end = "2017-10-15",
min = "2014-01-07",
max = "2017-10-15"
))))
我想让面板在没有鼠标悬停时透明,只有当光标在面板上时才不透明
最佳答案
使用
#sel_date:hover{
opacity: 1;
}
关于html - 在 R Shiny 中更改鼠标悬停时的不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47697683/