Sortables
, . , .
, sortables, , . , mousedown , , - . .
, <ul> <li>, 3: http://jsfiddle.net/qqqm6/10/
$('.sort').sortable({
revert: 'invalid',
connectWith: '.sort',
stop: function(){
$('.sort').each(function(){
$(this).sortable('enable');
});
}
});
$('.sort li').mousedown(function(){
$('.sort').not($(this).parent()).each(function(){
var $this = $(this);
if($this.find('li').length >= 3){
$this.sortable('disable');
} else {
$this.sortable('enable');
}
});
})
Draggables droppables
, , jQuery UI , . , - , , .
, drop ( 4 ):
$('.drag').draggable({
revert: 'invalid',
stop: function(){
$(this).draggable('option','revert','invalid');
}
});
$('.drop').droppable({
drop: function(event,ui){
var $this = $(this);
if($this.find('.drag').length >= 4){
ui.draggable.draggable('option','revert',true);
return;
}
ui.draggable.appendTo($this).css({
top: '0px',
left: '0px'
});
}
});
: http://jsfiddle.net/qqqm6/