Limiting the number of elements accepted by a sortable list help

Limiting the number of elements accepted by a sortable list help


Hi,
I sent this email with the wrong subject so I am sending it again with
the right subject.
I am using the interface plugin for jquery for drag and drop (sortable
lists). Is there any way I can limit the number of elements each list
can accept.
Here is my code (its indented by I don't know if the email will retain
that). In it, I want list 1 (ul1) to accept only 10 elemnts and stop
accepting any elements after that.
<script type="text/javascript" language="Javascript"
src="../libs/jquery/jquery.js"></script>
<script type='text/javascript' language='Javascript'
src="../libs/jquery/interface.js"></script>
<script type='text/javascript' language='Javascript'
src="../libs/jquery/jqmodal/jqmodal.js"></script>
<script type='text/javascript' language='Javascript'
src="../libs/jquery/jqmodal/jqdnr.js"></script>
<script type="text/javascript" language="Javascript"
src="../libs/jquery/dimensions/jquery.dimensions.pack.js"></script>
<script type="text/javascript"language="Javascript">
$().ready(function(){
$('#ul1').Sortable({
accept: '1',
opacity: 0.8,
onchange: function() {
return false;
}
});
$('#ul2').Sortable({
accept: '1',
opacity: 0.8
});
});
</script>
<body>
<ul id="ul1" class="q1">
<li id="li1" class="1">item 1</li>
<li id="li2" class="1">item 2</li>
<li id="li3" class="1">item 3</li>
<li id="li4" class="1">item 4</li>
</ul>
<ul id="ul2" class="q2">
<li id="li5" class="1">item 5</li>
<li id="li6" class="1">item 6</li>
<li id="li7" class="1">item 7</li>
<li id="li8" class="1">item 8</li>
</ul>
</body>
===
I tried changing the "accept" property to something else but if I do
that then the whole list just stops working. And, there is no way I
can get the list to refuse to assimilate an element into it.
Any help will be greatly appreciated. If you guys need more
information, I would be happy to provide it.
Thanks,
Moazzam Khan