I have a little project I\'m working on, and have an interesting containment issue using jquery\'s draggable:
Basically, I have two divs - a top & a
The containment option allows an array where to set the positions where to contain it. Try this:
var containmentTop = $("#stop-top").position().top;
var containmentBottom = $("#stop-bottom").position().top;
$('#bar').draggable({axis: 'y', containment : [0,containmentTop,0,containmentBottom] });
JSFiddle example