2012-01-23 3 views

답변

3

진행 콜백 1.8에 도입 된 애니메이션 jQuery를 :

$('#a').animate({ 
    opacity: 1, 
    width: 400, 
    percent: 100 
}, { 
    progress: function(animation, progress, msRemaining) { 
     $('#log').html(100 * progress + "%"); 
    } 
}); 
0

난 당신이 단계의 기능을

$('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; 
    } 
}); 

희망을 사용하여이 도움이 그렇게 할 수 있다고 생각합니다.