首页 > 解决方案 > 闪亮 - 我想通过使用 introBox 用图片替换按钮样式但不起作用

问题描述

我从 RShiny 画廊中的 app="https://shiny.rstudio.com/gallery/scotpho-profiles.html" 学习。

想实现点击图片放大跳转的功能。

但是在我的程序中,连图片都无法显示,路径还可以。到底是怎么回事?

library(rintrojs)
library(shiny)
ui <- shinyUI(fluidPage(
  introjsUI(), # must include in UI
  mainPanel(
    introBox(
      div(class="landing-page-box",
          div("title_box", class = "landing-page-box-title"),
          div(class = "landing-page-icon", style= paste0("background-image: url(D:/chord_diagram.png);background-size: auto 80%; background-position: center; background-repeat: no-repeat;")),
          actionButton("btn", NULL, class="landing-page-button")),
      data.step = 1,
      data.intro = "hello"
    )
    
  )))

server <- shinyServer(function(input, output, session) {
  output$mtcars <- renderTable({
    head(mtcars)
  })
})
# Run the application
shinyApp(ui = ui, server = server)

谢谢。

标签: javascriptrshiny

解决方案


推荐阅读