strange resizable containment behaviour

strange resizable containment behaviour


Hi
I'm trying to create a custom image crop tool using jQueryUI. I've got
a div containing an image, then another, smaller div absolutely
positioned within that to which i'm applying resizable and draggable.
I'm setting the containment parameter to the outer div for both the
resizable and draggable functions.
Unfortunately, when i drag any of the top or left handles outside of
the parent div, the inner div stops resizing but the positions
returned from the function continue changing, going into negative
numbers until i stop dragging.
I'd obviously not want the position coordinates returned to ever go
below zero. Any suggestions on what i'm doing wrong or what i can do
to remedy this please?
Thanks!