JQuery UI Sortable - disable sideways movement

Using the jQuery UI sorting function, the user can move the div in any direction. I want the user to be able to drag it up and down. How can i do this?

Thanks in advance.

+5
source share
3 answers

Specifically for sorting:

http://api.jqueryui.com/sortable/#option-axis

$( ".selector" ).sortable({ axis: "y" });

+17
source

Try something like this:

$('#items_wrapper').sortable({
    axis: 'y',
    containment: 'parent',
     ...
     ...
+3
source

You would use the axis method. See here api here .

0
source

All Articles