Hi all
I could move an object using jquery ui draggable, but I only want to move the object in x axis, now it moves on both x and y axis
Thank you
Hi all
I could move an object using jquery ui draggable, but I only want to move the object in x axis, now it moves on both x and y axis
Thank you
The docs:
Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values: 'x', 'y'. Code examples
Initialize a draggable with the axis option specified.
$( ".selector" ).draggable({ axis: 'x' });
Get or set the axis option, after init.
//getter
var axis = $( ".selector" ).draggable( "option", "axis" );
//setter
$( ".selector" ).draggable( "option", "axis", 'x' );