I’ve set up a jquery draggable, which can be moved around the entire document, it’s not contained by anything, and this is acceptable, as when the user drags, I want them to be able to drag as far down the page (or left or right) as they wish.
Indeed, the only restriction I want – is that they should be prevented dragging the element outside of the top of the page.
Is it possible to prevent dragging outside only one edge of a container?
You could overwrite the position of the element being dragged.
This fiddle is an example of the position overwriting : http://jsbin.com/ufarif/7/edit
Here is an example to not permit to be more close than 80 px of the left border