Limiting the draggable area

Maybe you can use the approach mentioned here: