I’m trying to detect when an element is being dragged. The jQuery documentation states that adding a .bind('drag' should do it. Unfortunately that’s not working in my case. I’ve verified that my item is draggable (init’d by jQueryUI).
//all of these elements show a "drag" listener, yet nothing happens
console.log($('#roster .sponsors li, #roster .players li'));
$('#roster .sponsors li, #roster .players li').bind('drag', function () {
$('.team div.sponsors, .team div.players').remove();
$(this).unbind('drag');
});
I’m trying to get the “drag sponsor here” div tag to go away when they start dragging…. http://jsfiddle.net/gEuZz/2/
update
Check out this problem — REMOVED —
Use the
sortstartevent. You’ll also want to bind the event using the same selector you used to create the sortables. Here’s a fork of your fiddle with these changes – http://jsfiddle.net/Bs6u7/.