0
稱爲自舉進度條我有這樣定義的進度條:從JavaScript錯誤
<div class="progress progress-striped active">
<div class="bar" style="width: 0%;"></div>
</div>
我使用的JavaScript代碼來同時改變杆的長度。下面是代碼
var progress = setInterval(function() {
var percent=(($scope.subcategory.planned2+$scope.subcategory.completed2)/($scope.subcategory.required2)*100);
var $bar = $('.bar');
$bar.width($bar.width()+percent);
$bar.text(percent + "%");
});
我得到正確的條的值當我運行我的程序,但由於某些原因,欄不顯示。它顯示一個空的進度條,但$bar.text
的值仍顯示出來。
謝謝..我使用了錯誤版本的語法。 – Abhishek