Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Community Answers

  1. jonathanawesome's post in Reversing timelines as functions within objects was marked as the answer   
    eek...I just realized a did a poor job explaining the issue.
    Back to the example in my initial post; reverse() wasn't working after already play()ing through the entire timeline and coming to a stop (in my non-example code, I'm preventing a reverse() action until the timeline has played through).
    I fiddled and fussed and realized maybe I was burying the timeline unnecessarily. This code works and gives me access to reverse() after play() is finished...
    var box = document.querySelector('.box'); var play = document.querySelector('.play'); var reverse = document.querySelector('.reverse'); var functions = { scale: new TimelineMax({paused: true}) .to(box, .5, {scale: 2}) } play.addEventListener('click', function() { functions.scale.play(); }); reverse.addEventListener('click', function() { functions.scale.reverse(); });