You're binding the mousemove event on the over-event of a draggable. That seems the issue - you should bind it once, together with calling draggable and droppable.
Jörn On Thu, Aug 20, 2009 at 12:00 AM, saturdayplace<[email protected]> wrote: > > Using the latest jQuery/UI that are hosted at Google. I've got the > following markup: > > <ul id="tree"> > <li><a href="1/">One</a></li> > <li><a href="2/">Two</a></li> > <li><a href="3/">Three</a></li> > </ul> > > And the following javascript: > > $(document).ready(function(){ > > // Droppable callbacks > function dragOver(overEvent, ui_object) { > $(this).mousemove(function(moveEvent){ > console.log("moved over", this); > }); > } > > function drop_deactivate() { > $(this).unbind(); > } > > function drag_out() { > $(this).unbind(); > } > > // Actual dragging > $("#tree li").draggable({ > revert: true, > revertDuration: 0 > }); > > // Actual dropping > $("a").droppable({ > tolerance: "pointer", > over: dragOver, > deactivate: drop_deactivate, > out: drag_out > }); > > }); > > If I drag the first li down over the second or third, the mousemove > function fires (and firebug logs the output). If I drag the second li > down over the third, the event mousemove function fires, but if I drag > it up over the first li it does not. Nor does it fire when I drag the > third element back up over either of the first two. You can see this > live at http://jsbin.com/ezihe. I've only tested this in Firefox > 3.5.2. > > It seems either the mousemove event is only binding to elements later > in the DOM than the one being dragged, or only those later elements > are receiving the 'over' callback function from droppable(). Is there > a reason for this? Should I be trapping the mousemove event in some > other way? Am I doing something wrong? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
