R Shiny 中的绝对面板隐藏在传单输出后面

Kar*_*mar 3 javascript css r shiny

我正在尝试全屏制作传单地图,并在地图顶部添加过滤器控件。但是,当我尝试这样做时,我的过滤器控件(绝对面板)在运行时隐藏在传单输出后面。

当我手动给出宽度时出现绝对面板

我希望地图是全屏的,当我这样做时,它会隐藏在地图后面。

如何使地图位于绝对面板后面?任何帮助表示赞赏。

谢谢

下面是界面代码:

fluidPage(style="padding-top: 10px;",
      h1("Locations"),
      absolutePanel(
        top = 60, left = "auto", right = 20, bottom = "auto",
        width = 330, height = "auto",draggable = TRUE,
        wellPanel(
          selectInput("Suburb", "Select one Suburb:",choices = c("Select one Suburb" = "All", as.character(mydata$SuburbTown))),
          uiOutput("secondselection")
          ),
        style = "opacity: 0.65"
          ),

      leafletOutput("leafl", height = "800px")
          )
Run Code Online (Sandbox Code Playgroud)

klu*_*luu 5

您可以更改z-index面板的 以使其正常工作。尝试这个:

fluidPage(style="padding-top: 10px;",
      h1("Locations"),
      absolutePanel(
        top = 60, left = "auto", right = 20, bottom = "auto",
        width = 330, height = "auto",draggable = TRUE,
        wellPanel(
          selectInput("Suburb", "Select one Suburb:",choices = c("Select one Suburb" = "All", as.character(mydata$SuburbTown))),
          uiOutput("secondselection")
        ),
        style = "opacity: 0.65; z-index: 10;" ## z-index modification
      ),

      leafletOutput("leafl", height = "800px")
)
Run Code Online (Sandbox Code Playgroud)

  • @Forever "z-index: 1000;" 也为我工作。谢谢你们!! (3认同)