0
我正在尝试显示进度百分比。因此,我给出了百分比类百分比来显示它,进度条的id是“progressbar”。我的js代码是,使用jquery显示进度条百分比
$("#progressbar").progressbar({
value: 50
});
$(document).ready(function() {
$("#progressbar").progressbar({
value: 0
});
var progress = setInterval(function() {
var currentVal = $("#progressbar").progressbar("value");
var nextVal = currentVal + 1;
$('#percentage').text(currentVal);
if (nextVal > 90) {
clearInterval(progress);
} else {
$("#progressbar").progressbar({
value: nextVal
});
}
}, 100);
});
现在,我怎么提前显示在#percentage
感谢百分比。
什么问题?你在控制台中收到某种错误吗?或者显示不正确,还是根本不显示? – jmunsch
[有没有办法显示jQuery UI Progressbar中的百分比数字?](http://stackoverflow.com/questions/3896891/is-there-a-way-to-show-the-percentage- number-inside-the-jquery-ui-progressbar) –
进度条是可见的。但我不知道如何显示它的百分比所以我用一个跨度与ID'百分比'。如何显示它的百分比? –