JSFiddle - React, Tailwind, and code Playground
by kougiland
HTML
<html>
<head></head>
<body>
<div id='test'>Test div is testing</div>
<img id='myimg' width='10' src='http://www.nystce.nesinc.com/images/tests_circle.gif' height='10' />
</body>
</html>
CSS
#test {
width: 200px;
height: 200px;
border: 1px dotted blue;
}
JavaScript
$(document).ready(function () {
var mousePosition = {'x': 0, 'y': 0};
$(document).bind('mousemove', function(e) {
mousePosition = {'x': e.pageX, 'y': e.pageY};
$("#test").offset({left:e.pageX,top:e.pageY});
});
});