【发布时间】:2016-06-01 03:16:56
【问题描述】:
我有一个闪亮的加载微调器,其实现类似于 this answer:
conditionalPanel(condition="$('html').hasClass('shiny-busy')",
tags$div("Loading...",id="loadmessage")
)
runApp(list(
ui = pageWithSidebar(
headerPanel("Test"),
sidebarPanel(
tags$head(tags$style(type="text/css", "
#loadmessage {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
padding: 5px 0px 5px 0px;
text-align: center;
font-weight: bold;
font-size: 100%;
color: #000000;
background-color: #CCFF66;
z-index: 105;
}
")),
numericInput('n', 'Number of obs', 100),
conditionalPanel(condition="$('html').hasClass('shiny-busy')",
tags$div("Loading...",id="loadmessage"))
),
mainPanel(plotOutput('plot'))
),
server = function(input, output) {
output$plot <- renderPlot({ Sys.sleep(2); hist(runif(input$n)) })
}
))
我遇到的问题是加载程序一直出现,即使闪亮只忙了几分之一秒。这导致应用程序一直闪烁。有没有办法基本上在条件面板上设置延迟,以便微调器仅在页面忙碌一秒钟后出现?
【问题讨论】:
标签: javascript jquery r shiny