I am using jquery sortable function for Li within a Ul tag, when i am dragging and dropping elements within ul, then i wanting that it can not be dragged left or right within ul. it should be dragged only up and down.
Try this:
$( ".selector" ).sortable({ axis: 'y' });
From the docs:
If defined, the items can be dragged only horizontally or vertically. Possible values:'x', 'y'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With