首页 > 解决方案 > RShiny中fluidRow内的盒子上的悬停功能

问题描述

我有一个非常大的闪亮应用程序,其中我有多个fluidRow,每个fluidRow 都有多个box 元素,我想在fluidRow 中的所有box 元素上创建一个悬停功能。

    library(shiny)
# library(rintrojs)

ui <- shinyUI(fluidPage(


  fluidRow(

    box(
      # h3(strong("OVERALL")),
      title = #h3(strong("OVERALL")),
        "OVERALL",
      width = 12,
      status = "primary",
      target = 'row',
      solidHeader = TRUE,
      align='center',
      collapsible = FALSE,
      DT::dataTableOutput("tab_PF1")
    )
  )
))

server <- shinyServer(function(input, output) {#Server file end

})

shinyApp(ui = ui, server = server)

查看 Shiny Tutorials 我可以看到悬停功能仅适用于 imageOutput 和 plotOutput

rshiny app 解释的悬停功能

那么有什么解决方案可以让我将鼠标悬停在我的盒子元素上吗?请帮助...代码只是它的一个示例。请调整,如果您提供相同的解决方案,那就太好了。

标签: shinyintro.js

解决方案


是的,库是可能的,shinyBS因为您可以使用它的功能BSTooltip,或者addToolTip分别在输入和输出以及 UI 和服务器中工作。

BSToolTip(title,...)
addToolTip(session,title,...)在服务器的 UI中
可用于工具提示:悬停、单击、双击


推荐阅读