다음 스 니펫으로 표시 : http://jsfiddle.net/sylouuu/V7a3Y/2/ 애니메이션의 #log에 % 진행률을 0 %에서 100 %까지 표시하고 싶습니다. 100 %는 콜백으로 간단합니다. ...jQuery animate() 애니메이션 진행률 표시
그렇게 할 수 있습니까?
안부
다음 스 니펫으로 표시 : http://jsfiddle.net/sylouuu/V7a3Y/2/ 애니메이션의 #log에 % 진행률을 0 %에서 100 %까지 표시하고 싶습니다. 100 %는 콜백으로 간단합니다. ...jQuery animate() 애니메이션 진행률 표시
그렇게 할 수 있습니까?
안부
진행 콜백 1.8에 도입 된 애니메이션 jQuery를 :
$('#a').animate({
opacity: 1,
width: 400,
percent: 100
}, {
progress: function(animation, progress, msRemaining) {
$('#log').html(100 * progress + "%");
}
});
난 당신이 단계의 기능을
$('myelementid').animate({
opacity: 1,
height: 100,
percent: 100
},
{
step: function(now, fx) {
//not sure if this is 100% percent accurate
//but at least you have a value at every step of the animation
console.log(this.percent);
},
complete: function(){
//do not forget to reset percent at the end of the animaton
//so on the next animation it can be calculated from starting value of 0 again
this.percent = 0;
}
});
희망을 사용하여이 도움이 그렇게 할 수 있다고 생각합니다.