2016-05-17 63 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>