Created
March 23, 2013 04:45
-
-
Save ynaoto/5226488 to your computer and use it in GitHub Desktop.
an animation effect that shows a phantom that moves $from to $to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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