2013-06-07 2 views
1

<div id="robert">stuff</div>으로 페이드되고 다음에 지정된 경로를 따르는 애니메이션이 있습니다. 베 지어 곡선 애니메이션 부분의 속도를 늦출 수있는 방법이 있는지 알고 싶습니다. 나는 그것을 "스윙"으로 여유를 갖도록 설정했지만 느려지는 일이 있습니까?Jquery 경로 제어 베 지어 속도

var pathRobert = { 
    start: { 
     x: 408, 
     y: 303, 
     angle: 72.594, 
     length: 1.390 
    }, 
    end: { 
     x: 510, 
     y:375, 
     angle: 233.366, 
     length: 1.138 
    } 
}; 

$(window).scroll(function(){ 
    //first animation for ipad with hands 

    if ((withinViewport((testimonials)) == true) && (peopleBlock !=0)){ 
     peopleBlock = 0; 

     $("#robert").fadeTo('fast',1).animate({ 
      path : new $.path.bezier(pathRobert) 
     },"swing"); 
    } 
}); 

감사합니다,

알렉스

답변

1

당신은해야합니다 ... 당신이 먹고 싶어 시간과 "swing" 교체 지속 시간과 완화를 지정할 수 있습니다.

.animate(properties [, duration ] [, easing ] [, complete ]) 

뭔가 같은 :

$("#robert").fadeTo('fast',1).animate({ 
    path : new $.path.bezier(pathRobert) 
},5000,"swing"); 

http://jsfiddle.net/kLRN2/

0

매우 간단 수정 :

$("#rita").fadeTo('fast',1).animate({ 
      path : new $.path.bezier(pathRita) 
     },800); 

단순히