Skip to content

Instantly share code, notes, and snippets.

@positlabs
Last active September 2, 2015 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save positlabs/7ac2ea02ead7daf1da4d to your computer and use it in GitHub Desktop.
Save positlabs/7ac2ea02ead7daf1da4d to your computer and use it in GitHub Desktop.
Filmstrip sprite example
$frame.css({
backgroundImage: 'url("' + imgPath + '")',
backgroundSize: numFrames*100 + '% ' + '100%'
});
var tl = new TimelineMax.to($frame, numFrames/frameRate, {
backgroundPosition: -(numFrames-1)*100+ '% 0',
ease: SteppedEase.config(numFrames-1),
delay: startDelay,
});
// various timeline max methods
tl.repeat(0); // infinite repeat
tl.play();
tl.reset();
tl.pause();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment