📅  最后修改于: 2023-12-03 15:32:19.896000             🧑  作者: Mango
jQWidgets jqxSortable is a lightweight jQuery plugin that provides a simple and easy-to-use interface for sorting elements. One of the key features of jqxSortable is the ability to specify the axis on which the sorting takes place.
The axis
property specifies the allowed axis of movement for the sortable element. It can be set to x
, y
, or xy
.
If the axis
property is not set, the sortable element will move horizontally and vertically.
$("#sortable").jqxSortable({
tolerance: 'intersect',
});
If the axis
property is set to x
, the sortable element will move only along the horizontal axis.
$("#sortable").jqxSortable({
tolerance: 'intersect',
axis: 'x'
});
If the axis
property is set to y
, the sortable element will move only along the vertical axis.
$("#sortable").jqxSortable({
tolerance: 'intersect',
axis: 'y'
});
If the axis
property is set to xy
, the sortable element will move along both horizontal and vertical axes.
$("#sortable").jqxSortable({
tolerance: 'intersect',
axis: 'xy'
});
In summary, the axis
property specifies the allowed axis of movement for the sortable element. Its default value is xy
, but it can be set to x
or y
for a more restricted movement. By using jqxSortable
with axis
property, you can easily add drag and drop functionality to your web application.