Created
October 10, 2014 15:25
-
-
Save efleming969/c5e549983f6c4860c8e5 to your computer and use it in GitHub Desktop.
Ball Animation
This file contains hidden or 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
<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