Skip to content

Instantly share code, notes, and snippets.

@blackxored
Created April 14, 2015 16:16
Show Gist options
  • Save blackxored/195df04eb7fa5baa99b5 to your computer and use it in GitHub Desktop.
Save blackxored/195df04eb7fa5baa99b5 to your computer and use it in GitHub Desktop.
promises = []
animate = (obj, property) ->
dfd = $.Deferred()
css = {}
css[property] = nextColor
console.log(css)
options = { duration: duration, complete: dfd.resolve }
$(obj).stop().animate(css, options)
promise = dfd.promise()
promises.push(promise)
promise
$('.color-splash')
.filter(colorElements.join(', ')).map((i) -> animate(i, 'color'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment