Someone
Someone

Reputation: 117

Displaying a button after progress bar complete

How can I make my bootstrap progress bar, display a button upon completion, removing the bar entirely? Here's the code.

$(function() {
  var current_progress = 0;
  var interval = setInterval(function() {
      current_progress += 10;
      $("#dynamic")
      .css("width", current_progress + "%")
      .attr("aria-valuenow", current_progress)
      .text(current_progress + "% Complete");
      if (current_progress >= 100)
          clearInterval(interval);
  }, 1000);
});

https://codepen.io/gustitammam/pen/RRXGdj

Once completed, it should display just a standard button with an a href wrapped around it.

Upvotes: 0

Views: 599

Answers (1)

user12067701
user12067701

Reputation:

-https://codepen.io/timd3v/pen/JjPBbzE

Hope it helps.

What changed:

  1. Created a button with a class and set the CSS display value to none
  2. Show the button, and hide the progress bar using the if statement you had already written

Upvotes: 1

Related Questions