Created
August 21, 2015 22:16
-
-
Save albertodelax/e10d6f2c76b5b3efb825 to your computer and use it in GitHub Desktop.
Cat and Laser Pointer
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Cat and Laser</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script> | |
<style type="text/css"> | |
html { | |
cursor: url('dot.png'), auto; | |
} | |
img { | |
position: absolute; | |
height: 40px; | |
transition: all 0.4s; | |
} | |
</style> | |
</head> | |
<body> | |
<img src="cat.png"> | |
<script type="text/javascript"> | |
$(document).on("mousemove", function(event){ | |
$("img").attr('style', 'top: ' + event.pageY + 'px; left: ' + event.pageX + 'px;'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment