【问题标题】:Background in shiny absolutePanel闪亮的 absolutePanel 中的背景
【发布时间】:2016-02-26 22:57:53
【问题描述】:

我想将absolutePanel的背景设置为透明,但面板中的所有控件都正常。

通过tags$style添加了一个css样式,但是所有子控件都变得透明了。我应该如何做到这一点?

PS:我下面的 css 代码不起作用

library(shiny)
ui <- shinyUI(

    fluidPage(
        tags$head(tags$style(
        HTML('
             #input_date_control {opacity : 0;}
             #sel_date {opacity: 1;}')
    )),
        absolutePanel(
        sliderInput('sel_date', NULL, 0, 5, 5, width = '80%')
        , id = "input_date_control", class = "panel panel-default", fixed = TRUE
        , draggable = FALSE, top = 'auto', left = '20', right = 'auto', bottom = 20
        , width = '60%', height = 'auto'
    )))

server <- function(input, output, session) {

}

shinyApp(ui, server)

【问题讨论】:

    标签: css r shiny


    【解决方案1】:

    以下页面中的建议:I do not want to inherit the child opacity from the parent in CSS,我解决了我的问题

    library(shiny)
    ui <- shinyUI(
    
        fluidPage(
            tags$head(tags$style(
            HTML('
                 #input_date_control {background-color: rgba(0,0,255,0.2);;}
                 #sel_date {background-color: rgba(0,0,255,1);}')
        )),
            absolutePanel(
            sliderInput('sel_date', NULL, 0, 5, 5, width = '80%')
            , id = "input_date_control", class = "panel panel-default", fixed = TRUE
            , draggable = FALSE, top = 'auto', left = 30, right = 'auto', bottom = 10
            , width = '60%', height = 'auto'
        )))
    
    server <- function(input, output, session) {
    
    }
    
    shinyApp(ui, server)
    

    【讨论】:

      猜你喜欢
      • 2016-05-12
      • 1970-01-01
      • 2014-08-18
      • 1970-01-01
      • 2016-02-18
      • 2016-05-03
      • 2016-02-26
      • 2021-11-15
      • 2019-07-01
      相关资源
      最近更新 更多