1

我一直在环顾四周,我发现的文档说他们为 bsmodal 函数添加了页脚和 button.close 参数,但它似乎不起作用。有人知道如何删除(甚至只是更改)关闭按钮,和/或删除 bsmodal 弹出窗口的整个页脚部分吗?

这是一个工作测试应用程序。我添加了一些 css 元素,以防有人有兴趣看到它的应用(我在自己的实际应用中使用了这些调整)

信息在这里找到:如果我在示例中应用它,它只会在弹出窗口中打印错误。

library(shiny)
library(shinyBS)

server <- function(input, output){

  }

ui <- fluidPage(
  fluidRow(
    actionButton(inputId = "test", label = "test", style = "background-color:red")

  ),

  bsModal(id = "AppZoom", 
          title = div(HTML('<span style="color:white; font-size: 40px; font-weight:bold; font-family:sans-serif ">Zoom Factor App<span>')), 
          actionButton(inputId = "Abutton", label = "SOMEBUTTON", style = "background-color:red"),
          trigger = "test", 
          size = "small", 
          footer = NULL, close.button = FALSE
  ),
  tags$head(tags$style(HTML(".modal-body {padding: 10px} 
                                       .modal-content  {-webkit-border-radius: 6px !important;-moz-border-radius: 6px !important;border-radius: 6px !important;}
                            .modal-sm { width: 380px;}
                            .modal-header {background-color: #3c8dbc; border-top-left-radius: 6px; border-top-right-radius: 6px}
                            .modal { text-align: right; padding-right: 20px; padding-top: 24px;} 
                            .modal-dialog { display: inline-block; text-align: left; vertical-align: top;} ")))

)
shinyApp(ui = ui, server = server)
4

2 回答 2

3

您还可以使用 CSS 将页脚的显示属性设置为“无”:

bsModal('boxPopUp1', 'test','test'),
tags$head(tags$style("#boxPopUp1 .modal-footer{ display:none}"))

希望这可以帮助!

于 2017-08-13T12:17:36.230 回答
0

似乎要启用该功能,您需要shinyBS从 GitHub 安装最新版本,使用以下命令安装它:

install.packages("devtools")
devtools::install_github("ebailey78/shinyBS")

请注意,它可能是一个不稳定的版本,所以要小心。

于 2017-07-26T18:55:41.247 回答