I'm working with a tennis ball emoji for a submit button, and I'd like to animate it off the screen when the user clicks on it.
I'd like for it maybe to move up the screen and shrink a little bit, and continue off the top of the screen. I suppose for realism it should bounce a little bit before it goes off the screen, but that would probably be a needless complication.
Here's what I've got so far jsfiddle:
(function() {
$(document).on('click','#save',clicked)
function clicked(myEvent) {
myEvent.preventDefault()
var local = {}
local.width = ["50px", "swing" ]
local.height = [ "50px", "swing" ]
local.top = "-64px"
$(this).animate(local,"slow")
}
})()
The problem is that it's not moving up the screen as it's shrinking. I'd like for it to look like you're serving the tennis ball for an ace.
May be something like this: http://jsfiddle.net/LaRWY/7/
You have to position the ball absolutely before running the JavaScript, using CSS: