Skip to content

Instantly share code, notes, and snippets.

@sbosell
Last active December 25, 2015 05:19
Show Gist options
  • Save sbosell/6924148 to your computer and use it in GitHub Desktop.
Save sbosell/6924148 to your computer and use it in GitHub Desktop.
function startAnimation() {
// empezar animacion
if (scope.isAnimated) {
timeFunctions.$clearInterval(scope.animateTimeout);
}
scope.animateTimeout = timeFunctions.$setInterval(animateBg, scope.Animation.speed, scope);
}
function animateBg() {
// camibar la pos de BG para la animacion
element.css({'backgroundPosition': calcBgPosition(stickyInfo.index, stickyInfo.nRows, stickyInfo.nCols, stickyInfo.nFrames, stickyInfo.width, stickyInfo.height)});
stickyInfo.index++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment