안녕 모두 부트 스트랩 4의 각 진행률 표시 줄에 대한 제한을 설정하려고합니다. 클릭시 트리거하려고합니다. 지금까지 나는 내가 각각 진행 막대의 최대 값을 설정할 수있는 방법 값은 항상 100로 이동어떻게 한계 값으로 설정 - jquery
클릭하면
문제는?
다음은 코드입니다. 당신이 거기 당신을 위해 그것을 할 것을이 are, plenty, of, libraries을 진행 표시 줄이 필요하면
<button>run</button>
<progress class="progress progress-striped progress-animated limit70" value="" max="100"></progress>
<progress class="progress progress-striped progress-animated limit80" value="" max="100"></progress>
$('button').on('click', function() {
$('.progress').each(function() {
var progBar = $(this);
var perc = progBar.attr("max");
var userInput = $('input#speed').val(); // in seconds
var speed = userInput * 10;
var currentPerc = 0;
var progress = setInterval(function() {
if (currentPerc >= perc) {
clearInterval(progress);
} else {
currentPerc += 1;
progBar.attr('value', (currentPerc) + '');
}
progBar.attr((currentPerc) + '');
}, speed);
});
});
는 여기 fiddle
를? –
플러그인을 사용하지 않았습니다. 부트 스트랩 4 진행 막대를 사용하여 jquery를 추가하여 애니메이션을 실행했습니다. –