Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
app = angular.module 'dashboard'
app.animation '.appear', [->
addClass: (element, className, done) ->
$element = jQuery element
$element.removeClass className
$element.css 'opacity', 1
$element.animate {opacity: 0}, 300, 'linear', ->
$element.addClass className
done()
(isCancelled) ->
$element.stop() if isCancelled
removeClass: (element, className, done) ->
$element = jQuery element
$element.css 'opacity', 0
$element.animate {opacity: 1}, 200, 'linear', done
(isCancelled) ->
$element.stop() if isCancelled
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.