An ul list contains some items. The last item must always stay in a static position. I've tried to use cancel
option of the .sortable()
method, but it doesn't switch off sortable, just dragging.
<ul id="sort">
<li>Jquery</li>
<li>MooTools</li>
<li>Prototype</li>
<li>YUI</li>
<li class="last">must stay static (add position button)</li>
</ul>
$('#sort').sortable({
cancel: '.last'
});
Example fiddle: http://jsfiddle.net/mbarinov/JLZvY/
You can use the items options to specify a selector which excludes items that expose the last
class:
$('#sort').sortable({
items: "li:not(.last)"
});
You will find an updated fiddle here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With