Anshul
Anshul

Reputation: 9480

How to restrict containment property of sortable to any div?

The containment property limits the drag of the elements to the edges of the browser window. Which give me scroll bar lengthy with empty space.I have a list within a div drop_down_listnow for making sortable I wrote following code:

  $('.drop_down_list').sortable({                        // make drop down sortable.
         axis: "y",
         placeholder: ".drop_down_list_placeholder",
         forcePlaceholderSize: true,
         containment: ".drop_down_list",
         scrollSpeed: 3000
   });

but when I am dragging my li element outside the div than scroll bar is still increasing and I am getting white space in my div, after dropping element everything is OK. I want to restrict my scroll bar length within my div, how can I do that ? jsfiddle link for the problem- http://jsfiddle.net/mqnrD/24/

Upvotes: 0

Views: 332

Answers (1)

user681536
user681536

Reputation: 26

In the jsfiddle, adding "scroll: false" to the sortable callback should fix this.

Upvotes: 1

Related Questions