Last active
August 29, 2015 13:57
-
-
Save gcr/9853918 to your computer and use it in GitHub Desktop.
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
<!doctype:html> | |
<style> | |
#target { | |
background-color: #800; | |
display: inline-block; | |
position: absolute; | |
padding: 0.5em; | |
border-radius: 0.3em; | |
color: #fff; | |
} | |
</style> | |
<span id="target">Try to click me!</span> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script> | |
$("#target").on("mouseover", function(){ | |
// Move the target out of the way, heehee | |
$("#target").animate({ | |
top: 500*Math.random(), | |
left: 500*Math.random() | |
}, 300); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment