views:

178

answers:

1

Hi guys, is it possible to set constraints for a draggable obeject? I have this line:

$("#info").draggable({ axis: 'y' });

i want this only to be draggable 200px towards the top. It should not be draggable towards the bottom? Is there any way to do that?

+1  A: 

Did you check the demos? http://jqueryui.com/demos/draggable/#constrain-movement

You can use a few of the shown options to achieve what you are looking for (like making a container div that is 200 px higher, etc).

Cryophallion
thank you! haven't seen the demos!