minddust / bootstrap-progressbar

progressbar interactions for twitter bootstrap 2 & 3
www.minddust.com/project/bootstrap-progressbar
MIT License
577 stars 160 forks source link

Run .progressbar() on every button click #25

Closed thewebsitedev closed 10 years ago

thewebsitedev commented 10 years ago

I am trying to run .progressbar() on every button click but it does not work after one click. I mean .progressbar() grabs and stores the first values only and does not update the values on subsequent clicks.

How can I run it with new values every time the button is clicked?

I am using the below jQuery -

$('#progress-bars-preview').click(function(){
    var percent = $('#progress_bar-percent').val();
    if(percent=="percentage"){
        percent = true;
    }else{
        percent = false;
    }
    $("#demo-progress-bar .bar").progressbar({
        display_text: "fill",
        done: function(current_percentage) {
            $("#demo-progress-bar .bar span").show("slow");
        },
        use_percentage: percent
    });
});
minddust commented 10 years ago

looks like you are note updating aria-valuetransitiongoal.

take a look at the multitrigger example:

http://www.minddust.com/bootstrap-progressbar/bootstrap-3.0.0-rc2.html#m-multi-trigger-0