Skip to content

Instantly share code, notes, and snippets.

@patsma
Created February 16, 2018 00:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patsma/997c9e733abb06b1b5a2838ad3002a00 to your computer and use it in GitHub Desktop.
Save patsma/997c9e733abb06b1b5a2838ad3002a00 to your computer and use it in GitHub Desktop.
Some may find this confusing, but I like to tack .reverse() onto the end and toggle an animation like this...
var tl = new TimelineMax()
.to("#box", 0.25, { opacity: 0.5, scale: 0.75 })
.reverse();
$("#box").click(function() {
tl.reversed(!tl.reversed());
});
http://codepen.io/osublake/pen/9d46535fe6e5b5c8f577308a5ae1ea72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment