Reputation: 3362
Well i tried to do something like this :
var oldX=0,oldY=0;
$('body').mousemove(function(e){
$('.movestatus').text('mouse moved');
var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
$(".chords").text(clientCoords);
var ap = $("<div class='k'></div>");
ap.offset({ top: e.clientX, left: e.clientY });
$("body").append(ap);
oldX = e.clientX;
oldY = e.clientY;
});
Well this works BUT the added div are added a lot below where the mouse actually is and also not added always.
How can i fix this ?
Upvotes: 2
Views: 1281
Reputation: 114417
One little thing you forgot:
.k {
height:10px;
width:10px;
background:red;
position:absolute; <-------
}
Upvotes: 1