im trying to move the div according to mouse event and direction, i mean to move the div in the same direction, in which moves the mouse, but for the movement of div there will be limits. so far i have this:
$("#foo").mousemove(function(event) {
$("#bee1").animate({"left": "150px"}, 2000)
});
and css:
#bee1 { position:absolute; top:200px; left:160px; }
now the div moves just in one direction, after the mouse is moved, and stops. but i want it to be moved in the way moves mouse, in the same direction )) how do i do it?!
Thank you all for help!
I think you are looking for this
Working demo