Hi all, using the Draggable feature:
http://jqueryui.com/demos/draggable/
How can I limit the draggable div so it hits the sides of the container?
It states I can do this:
Quote:
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' );
|
But I don't really understand it. :S Not great with Javascript - so please make it simple!
Thanks.