我正在使用 dragulaR 在 Shiny 中创建可拖动的 div,并使用 shinyBS 向每个 div 添加了一个工具提示。我想知道是否可以在拖动 div 时删除工具提示(我尝试jQuery从JQuery UI添加:在拖动开始时删除可拖动克隆上的 Bootstrap 工具提示?)?library(shiny)library(dragulaR)library(shinyBS)makeElement <- function(data, name){ div(style = "border-width:2px;border-style:solid;", drag = name, div(class = "active-title-row", id = name, name), bsTooltip(id = name, title = "Hover", placement = "top", trigger = "hover"))}ui <- fluidPage( # Maybe something like this but it doesn't work tags$script(HTML( "$(function() { start: function(event, ui) { $('#bsTooltip').hide(); });" )), titlePanel("Drag and drop elements with dragulaR"), fluidRow(style = "margin: 15px;", column(3, h3("Drag from here:"), div(id = "Available", style = "min-height: 600px;", lapply(colnames(mtcars), makeElement, data = mtcars)) ), column(3, h3("Drop here:"), div(id = "Model", style = "min-height: 600px;") ) ), dragulaOutput("dragula"))server <- function(input, output) { output$dragula <- renderDragula({ dragula(c("Available", "Model")) })}shinyApp(ui = ui, server = server)
1 回答
有只小跳蛙
TA贡献1824条经验 获得超8个赞
通过删除函数中的title文本,makeElement您将能够在拖动元素时删除“悬停”工具提示。
makeElement <- function(data, name)
{
div(style = "border-width:2px;border-style:solid;",
drag = name,
div(class = "active-title-row", id = name, name),
bsTooltip(id = name, title = "",
placement = "top", trigger = "hover"))
}
添加回答
举报
0/150
提交
取消