Reputation: 23959
I have a bunch of elements on a page which are draggable and determined by:
$( ".folder" ).draggable({ revert: true });
I need to make one element, which has class .folder
, not able to be dragged (it's the top folder in a tree).
I tried removing the class ui-draggable from it but that didn't work so I'm guessing the above code overrides it?
Is this possible?
NOTE: I can't simply change the class name as they are also droppable and the top folder in the tree is also droppable.
Upvotes: 0
Views: 132
Reputation: 2725
just use:
$( ".folder" ).draggable("disable"); //or enable
Upvotes: 0
Reputation: 40639
Try this,
$(".folder:not(:first)").draggable({ revert: true });
Read :not and :first selectors
Upvotes: 1