如何在悬停时显示侧边栏而不是单击 Shiny?
How to make appear sidebar on hover instead of click in Shiny?
我正在开发一个闪亮的应用程序,并在 UI 部分使用了 shinydashboard 包。我想在悬停时打开侧边栏而不是单击按钮。我已经尝试过数据触发选项,但它不起作用。谁能帮我做这件事?
闪亮仪表板应用程序的最小示例
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody()
)
server <- function(input, output) { }
shinyApp(ui, server)
你可以用 JQuery:
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(),
tags$head(tags$script(HTML("$(function() { $('a.sidebar-toggle').mouseover(function(e) { $(this).click()})});")))
)
server <- function(input, output) { }
shinyApp(ui, server)
我正在开发一个闪亮的应用程序,并在 UI 部分使用了 shinydashboard 包。我想在悬停时打开侧边栏而不是单击按钮。我已经尝试过数据触发选项,但它不起作用。谁能帮我做这件事?
闪亮仪表板应用程序的最小示例
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody()
)
server <- function(input, output) { }
shinyApp(ui, server)
你可以用 JQuery:
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(),
tags$head(tags$script(HTML("$(function() { $('a.sidebar-toggle').mouseover(function(e) { $(this).click()})});")))
)
server <- function(input, output) { }
shinyApp(ui, server)