Jump to content
GreenSock

meettrivedi

Trouble while resuming after tweenTo function

Recommended Posts

I am trying to use tweenTo to skip panels if user clicks on it, but when i use oncomplete: resume , it goes back to panel where it was clicked rather than continuing. I apologize as I could not make a codepen.
 

$(document).on("click", "h1", function(e) {
var label = $(this).attr("panel");

e.preventDefault();

var t=timeline.getLabelTime(label);
timeline.tweenTo(t,{onComplete:resume, onCompleteParams:[], ease:Strong.easeOut});

function resume()
{
timeline.resume(label);
//it does not resume from label or time t
}

});
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

Not really sure I understand the issue fully but I see no problem with a timeline resuming after using tweenTo().

 

I did a quick demo and you will see that 

 

  1. the timeline is created in a paused state
  2. i tweenTo() a label named spin
  3. when the tweenTo() is done the resume function is called and the timeline continues playing
var tl = new TimelineMax({paused:true});


tl.to(".green", 1, {x:300})
  .add("spin")
  .to(".green", 1, {rotation:360})




tl.tweenTo("spin", {onComplete:resume})


function resume() {
  tl.resume();
}

 

http://codepen.io/GreenSock/pen/grJLJZ?editors=0010

 

This is why it is so critical to provide a demo, its very difficult for us to guess and simulate your issue.

Perhaps you can fork my demo and add some code similar to what you are doing so we can see it not working.

We do not need to see your full project or any real production files like images. Just something very simple that shows the issue.

 

Thanks!

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×