javascript - Display progress bar percentage using jquery -
i trying display percentage of progress .so, i've given span class percentage display there , id of progress bar "progressbar". js code is,
$("#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); });
now how can display percentage @ #percentage
thanks in advance.
isn't
var currentval = $("#progressbar").progressbar("option", "value");
supposed
var currentval = $("#progressbar").progressbar("value");
these should checkpoints
- include jquery.
- include jquery-ui after jquery script.
- include css
Comments
Post a Comment