Created
November 21, 2011 22:28
-
-
Save ElemarJR/1384173 to your computer and use it in GitHub Desktop.
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> | |
<head> | |
<title>JQuery Events</title> | |
<style type="text/css"> | |
canvas | |
{ | |
border: 1px solid Black; | |
} | |
</style> | |
</head> | |
<body> | |
<canvas id="myCanvas" width="500" height="500"> | |
</canvas> | |
<div id="target"> | |
</div> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> | |
<script src="rx.js" type="text/javascript"></script> | |
<script type="text/javascript" src="rx.jQuery.js"></script> | |
<script type="text/javascript"> | |
$(function () { | |
var mousemove = $("#myCanvas").toObservable("mousemove"); | |
mousemove.Subscribe(function (e) { | |
$("#target").text(e.clientX + ", " + e.clientY); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment