This is my demo: http://jsfiddle.net/michelejs/PeS2D/560/
How can I stop the first <li>
being draggable?
$(document).ready(function(e) {
$('li').removeClass('ui-corner-bottom');
$('ul')
.addClass('ui-corner-top')
.removeClass('ui-corner-all')
.sortable({
'containment': 'parent',
'opacity': 0.6,
update: function(event, ui) {
alert("dropped");
}
});
});
Thanks a lot.
You can use the items
property:
$(document).ready(function(e) {
$('li').removeClass('ui-corner-bottom');
$('ul')
.addClass('ui-corner-top')
.removeClass('ui-corner-all')
.sortable({
items: 'li:not(:first)',
'containment': 'parent',
'opacity': 0.6,
update: function(event, ui) {
console.log(ui)
}
});
});
http://jsfiddle.net/ppRJL/
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