Closed jamielob closed 9 years ago
Thanks for the kind words :) Here's the jQuery code. See demo http://codepen.io/desandro/pen/LVQqgm
var $draggable = $('.draggable').draggabilly();
// disable other draggabillies on dragStart
$draggable.on( 'dragStart', function( event ) {
$draggable.filter( function( i, elem ) {
return elem != event.target;
}).draggabilly('disable');
});
// re-enable on dragEnd
$draggable.on( 'dragEnd', function() {
$draggable.draggabilly('enable');
});
Demo with vanilla JS: http://codepen.io/desandro/pen/GJQzPL
Perfect. Thanks!
Hi!
What's the easiest way to disable all other draggable items once you have started dragging on something?
p.s. Fantastic piece of kit @desandro - best drag library I've used so far.