I'm not a whiz at interface, but here's a rough stab at it to get you
started with something. Totally untested, so good luck :)

$('#firstList').Droppable({
  ...,
  onDrop: function(drag) {
     if($(this).size() > 3) {
        $(this).children(':last').prependTo('#secondList');
     }
  }
});

If you're using it with some sort of Sortable thing, you might want to
do it onHover instead of onDrop. Also, if you do do it onHover, you
might want to check if the last element is the draggable, and if so,
bump the second to the last element to the second list, so that
putting the draggable at the end of the first list will keep it there
and bump the one before it down.

Good luck with it.

--Erik


On 6/28/07, Michael Price <[EMAIL PROTECTED]> wrote:

Here's a tricky one (although it probably won't turn out that way in the
end!)

I've got two unordered lists and I'm using Interface to allow items to
be dragged between the two. However, if possible I'd like to limit the
top list to only contain a maximum of 3 items, with any further items in
the bottom list. If an item is dragged into the top list, any item
outside the top 3 moves down into the bottom list.

I've honestly got no idea where to start with this - can anyone provide
some tips?

Regards,
Michael Price


Reply via email to