I have a simple draggable and droppable list that essentially uses the
code from the jQuery UI docs ('simple photo manager'):
http://jqueryui.com/demos/droppable/#photo-manager

How would I go about limiting the number of items in the droppable
target div? For example, in the simple photo manager linked above, say
I want to limit the number of items that get put in the trash to two.
If the user then drags another photo into the trash (photo number 3),
it does not get accepted.

I have looked at the excepted elements example (http://jqueryui.com/
demos/droppable/#accepted-elements) which I guess could be a method:
if the number of items in the trash is two, then change the class on
all the other remaining photos to be non-droppable. If the number of
items in the trash is less than two, then keep the class assignment as
droppable.

Does this seem like a good approach? Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to