By making use of option containment you can restrict the boxes to be draggable inside a particular DIV:
$('#BoxId').draggable({
containment: "#containerId",
drag:function(e){
jsPlumb.repaint($(this));
}
});
for jsPlumb draggable:
jsPlumb.draggable($("BoxId"), {
containment:"containerId" // no need of '#'
});