Created
April 14, 2011 16:33
-
-
Save kieran/919864 to your computer and use it in GitHub Desktop.
still brittle since it depends on active & hover classes, but removing those dependencies should be trivial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#element").droppable({ | |
tolerance: 'pointer', | |
activeClass: 'ui-state-active', | |
hoverClass: 'ui-state-hover', | |
drop: function(evt, ui) { | |
console.log('dropped',evt,ui) | |
} | |
}); | |
$('.ui-droppable').live('dropover dropout',function(evt,ui){ | |
//var scope = $(this).droppable('option','scope') // TODO: watch for scope | |
$('.ui-droppable').droppable('enable') | |
$('.ui-state-hover').not($('.ui-state-hover').last()).droppable('disable') | |
}).live('drop',function(evt,ui){ | |
$('.ui-droppable').droppable('enable') | |
$('.ui-droppable').removeClass('ui-state-hover ui-state-active') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment