Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created October 10, 2014 15:25
Show Gist options
  • Save efleming969/c5e549983f6c4860c8e5 to your computer and use it in GitHub Desktop.
Save efleming969/c5e549983f6c4860c8e5 to your computer and use it in GitHub Desktop.
Ball Animation
<script src="vendor/jquery.js"></script>
<style>
#ball {
position: relative;
top: 290px;
}
#lane {
position: relative;
height: 300px;
width: 100px;
border: 1px solid black;
padding: 20px;
}
</style>
<div>
<div id="lane"><div id="ball">i'm a ball</div></div>
</div>
<button id="go">Go</button>
<script>
$( "#go" ).click(function() {
$( "#ball" ).animate({ "top": "-=300px" }, "fast" );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment