Dragabbale/Resizable containment / proportional resizing
Dear devs,
I am trying to implement a simple image cropper using JQuery UI 1.5
I am using the draggable and resizable interfaces. The html code goes
like this:
<div id="crop_container">
<div id="cropper" />
<img src="the image to crop" />
</div>
The cropper more or less works. However I have two problems:
- How can I constrain the dragging and resizing of #cropper inside
crop_container? I tried:
$('#cropper').draggable({containment: 'parent'})
$('#cropper').draggable({containment: '#crop_container'})
without luck..
- How can I force the resizing to be proportional, ie to keep the
aspect ratio?
thanks in advance, for your help,
George.