jquery custom drag and drop
- by samlochner
I am trying to create functionality similar to drag and drop. I need to create my own as there will be some significant differences to the drag and drop in the jquery UI.
I would like to have mousemove being called repeatedly at all times, and mousedown called every time the mouse is pressed. So I have the following code:
$(document).bind('mousemove',function(e){
$("#coords").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
$(document).bind('mousedown',function(e){
});
('coords' is the id of a div)
As I move the mouse, coordinates are reported correctly in 'coords'. If I depress a mouse button and then move the mouse, coordinates are still reported correctly. But if I depress a mouse button on an image and then move the mouse, coordinates are reported correctly for a few sets, and then they seize up! Why is this happening and how can I fix it?
Thanks,
Sam