i have a div i want to drag confined in a particular container. i tried using the containment: parent option but this results in the div getting snapped to upper or lower bounds without dragging. i have overflow:hidden set, i hope that is not a problem. (i read it somewhere)
pls help me out.
the code:
imgCanvas.appendChild(img);
overlay.appendChild(imgContainer);
$(document).ready(function() {
$("#draggable").draggable({
containment: '#imgContainer',
scroll: false
});
});
the #draggable is a div that contains the img, and #draggable is appended to imgContainer. i hope this helps somehow.