I have a list of items and I want to make the first item in the list unsortable and unmovable. The first item in the list should always stay as the first item in the list. H
Mmm, hard to say for certain. I've not used sortable/draggable combination before, moreover the UI documentation doesn't expressly address the sortable/draggable combination.
However, from what I have read in the documentation, something like this should work :
$(function() {
$("#lineup li").disableSelection().addClass('ui-state-default').eq(0).addClass('ui-state-disabled');//alternatively, write classes as HTML attributes
$("#lineup").sortable({
items: "li:not(.ui-state-disabled)" //should disable draggable and sortable
});
});