Skip to content

Instantly share code, notes, and snippets.

@ynaoto
Created March 23, 2013 04:45
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 ynaoto/5226488 to your computer and use it in GitHub Desktop.
Save ynaoto/5226488 to your computer and use it in GitHub Desktop.
an animation effect that shows a phantom that moves $from to $to.
tween = ($from, $to, therefore) ->
$a = $from.clone()
$from.css(opacity: 0.75)
$a.css(position: 'absolute')
.css($from.offset())
.css('border-color', 'transparent')
$from.parent().append $a
$a.animate $to.position(),
complete: ->
$a.remove()
$from.css(opacity: 1)
do therefore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment