2016-05-17 54 views
1

我必须修复工作进度条。由于我对编码相当陌生,所以我遇到了一个大问题。我无法在进度条的中心显示消息。无法看到进度条标签

这是进度代码:

progress: { 
     show: function (msg) { 
      notify.hideAll(); 
      var progress = $("<progress>"); 
      progress.attr("max", "100"); 
      progress.attr("value", "0"); 
      progress.attr("showText", "true"); 
      $(progress).append('<div id="progressLabel"></div>'); 
      $(sel(params.classNotifyBottomSmall)).find(sel(params.classNotifyButton)).hide(); 
      $(sel(params.classNotifyBottomSmall)).find(sel(params.classNotifyMsg)).html(progress); 
      $(sel(params.classNotifyBottomSmall)).find(sel(params.classNotifyIcon)).hide(); 
      notify.glass.show(); 
      $(sel(params.classNotifyBottomSmall)).show(); 
      return progress; 
     } 

这是测试条

setTimeout(function() { 
     var progress = brmgui.notify.progress.show("Testfortschritt!"); 
     var pValue = 0; 
     setInterval(function() { 
      $(progress).attr("value", pValue); 
      pValue++; 
      $("#progressLabel").html("Wird geladen... " + (pValue-1) + "%");   
     }, 1000); 
    }, 3000); 

在谷歌的开发工具,它看起来像这样的功能:

enter image description here

但标签不能在酒吧内看到。所以我对我的问题很无知。

标签的CSS很简单:

#progressLabel{ 
      text-align: center; 
      line-height: 30px; 
      color: white;    
     } 

所以,如果有人可以帮助我,我将非常感激!

+3

你能提供一个工作片段吗? – Randy

+2

小提琴将有助于回答。 –

回答

0

而不是把标签放在<progress>里面,把它放在.progress-text是更新值的地方。

<label> 
    <progress value="50" max="100"></progress>Wird geladen... 
    <span class="progress-text">50%</span> 
</label>