html - 在 R Shiny 中更改鼠标悬停时的不透明度

标签 html css r shiny

我的 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"
                 ))))
                                    

The output of the code

我想让面板在没有鼠标悬停时透明,只有当光标在面板上时才不透明

最佳答案

使用

 #sel_date:hover{
opacity: 1;
}

关于html - 在 R Shiny 中更改鼠标悬停时的不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47697683/

相关文章:

javascript - 如果我更改端点,中间件将不起作用

javascript - 通过点击按钮显示不同的表格

css - Google PageSpeed - 消除由 Google Fonts 引起的首屏渲染阻塞资源

开箱即用的 CSS 内容溢出 IE <6

Shiny 的 R : How can I adjust radio buttons to the grid width of column?

javascript - 如何在Android应用程序中防止网站页眉和页脚

html - 如何在包装类的 css 上使用内联 css 或完全使用另一个类?

CSS : li hover doesn't work in internet explorer 6

r - 有效地计算 R 中的滚动行总和

r - 如何使用 R 绘制世界地图