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