質問

Please take a look before: http://jsfiddle.net/j08691/67rZz/

When i'm trying to disable an item and the item 3 is reaching the top. you cant put items above it. what I want to do is that I won't be able to move the item 3 but that I could put items above it.

how can I do that?

役に立ちましたか?

解決

It seems that you want the item to remain sortable, but not moveable. See this jsfiddle. Code:

 $(".sortable").sortable({
      items: "li"
    });

 $(".sortable").disableSelection();
 $('.unsortable').mousedown(function()
 {
     return false;
 });

All it does is cancels the mousedown event: see here about information for returning false from event handlers. It will prevent the default event from occurring and prevent the event from bubbling up to the other event handlers.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top