I would like to prevent a connected jquery-ui sortable List to accept no more Items than of a given number.
I came this far: http://jsfiddle.net/9yzea/6/
What to add in line 66 to prevent "#playlist" to react on an new item hovering above it? I would like it to react with sepcial behaviour since its "full". Or is there a better approach?
Thank you
$(function() { $( "#playlist" ).sortable({
cursor: "move",
handle: ".handle",
revert: 100,
opacity: 0.8,
delay: 50,
placeholder: "sortable-placeholder",
stop: function(event, ui) {
var size = $("#playlist li.track").size();
$("#music").append(size+" ");
sizeCheck();
if (playlistFull) {
$("#music").append("full ");
} else {
$("#music").append("space ");
};
playlistWatcher();
},
start: function(event, ui) {
if (playlistFull) {
// $(ui.item).sortable('cancel'); // What to do here?
};
},
}).disableSelection();
});