You bind them to a callback function that actually moves your element
around. Like so:
function docmove(ev) {
// use ev (event object) to get current mouse position, compare to
original
// move element based on difference
}
$("#someTargetElement").mousedown(function(ev) {
// use ev to get s
Hi, I've been trying to do this same thing (move a draggable around by
clicking on something else) but I can't figure out Richard's
suggestion. He says to "bind document.mousemove and document.mouseup"
but I can't figure out what to bind it to...what exactly do I need to
put in the callback? Not
I would recommend the following:
1. On element.mousedown, bind document.mousemove and document.mouseup.
2. On document.mouseup, unbind mousemove and mouseup.
3. Don't worry about sending the drag events (mousemove) to the element
that's actually going to be moving, just handle the events at the do
3 matches
Mail list logo