|
Title: Draggable feature Post by: Giandomenico Pastore on October 21, 2012, 12:43:09 AM Hi,
I can constrain a draggable object to be dragged only within the scope of its parent object? Title: Re: Draggable feature Post by: stworthy on October 21, 2012, 05:50:14 AM Place the draggable object in a relative-positioned div.
Code: <div style="position:relative;overflow:auto;width:400px;height:400px"> Title: Re: Draggable feature Post by: Giandomenico Pastore on October 21, 2012, 11:21:09 PM In this way the drag continues beyond the perimeter, although hiding overflow when going over is not seen. is possible make sure that the dragging can not go beyond the edges of the container div?
Title: Re: Draggable feature Post by: stworthy on October 22, 2012, 12:01:58 AM You can add some code in 'onDrag' and 'onStopDrag' events to limit the boundaries of the draggable area.
Code: <script> Title: Re: Draggable feature Post by: Giandomenico Pastore on October 22, 2012, 12:40:09 AM Great! Thank you so much for your support. I think that this function may be integrated into the plugin "draggable", with an option such as "constrainInParent: true". Regards. ;)
|