jQuery UI's sortable doesn't allow dropping outside of the parent
If you look at the default sortable example, the "drop zone" is defined by where the mouse pointer is within the list -- that is, if you've drag the last item to the top while your mouse pointer stays outside the list the entire time, "letting go" of the item will send it back to its previous position.
If you use the "axis" argument (for this example you would likely set axis:开发者_C百科 'y' so that items can only move up and down) I would think that the x-coordinate of the mouse pointer should be irrelevant. Is there an easy way to set this so the drop zone is anywhere on the page and the item is moved to the position based on the pointer's y-coordinate?
Are you sure the sortable system is the one you need, from the sounds of your second paragraph dont you just want to make an element draggable? ( see http://jqueryui.com/demos/draggable/ )
Would you be better using that to then lock the x-axis and let it be dragged anywhere along the y-axis. Hope I understood you correctly, just a thought.
Took a look at the intersection code and couldn't find anything that changed depending on what the axis was set as. Submitted a pull request to jQuery UI which modifies the definition of "intersection" depending on the draggable axis.
精彩评论