2013-08-01 7 views
0

각 항목을 슬라이드 한 후 잠시 멈추는 동안 내 div의 각 요소를 슬라이드하려는 경우 아래에 내 코드가 첨부되어 있습니다.
$ (함수() {타임 라인 라이트에서 일시 중지가 작동하지 않습니다.

$() 각 (함수() {

VAR $으로 자기 = $ (이) '틱.'].

var에 T1 = 새로운 TimelineLite() ;

t1.to ($ 자체, 0.5, {X : 100, 난이도 Cubic.easeInOut})

t1.pause();

t1.resume();

}) '

설명 : 한 번에 모든 항목을 슬라이드합니다. 각 항목을 슬라이드 한 후 일시 중지하지 않습니다 ... 코드의 문제점은 무엇입니까?

감사 & 감사합니다,

Bunnie

답변

0
var delayTween = 0.1; // your pause time in seconds 
var tweenArr = []; 

// I have put this line outside of each block because it will re insatiate t1 all the time, and we require to initialise it only once 
var t1 = new TimelineLite(); 

$('.tick').each(function() { 

    // var $self = $(this);  
    // there is no need to bind this to jquery object because tweenmax works well with "this" (html element) 

    tweenArr.push(
     TweenMax.to(this,0.5,{x:100,ease:Cubic.easeInOut}); 
    ); 

}); 

t1.add(
    tweenArr, 
    '+=0', 
    "sequance", 
    delayTween 
); 
0

일이 뭐죠은 pause()를 호출 한 다음이 바로 후 resume()를 호출합니다.

to() 트위닝을 추가하고 비어있는 targetvars 개체를 전달하기 만하면됩니다. 그런 다음 duration을 원하는 일시 중지 시간으로 설정하십시오.

// pause timeline for 5 seconds 
t1.to({}, 5, {}); 

또한 참조 : GreenSock Forum Topic - Inserting a pause delay wait into timeline

희망이 도움이! :)