How do I change the maxHeight value of a resizable Div?

How do I change the maxHeight value of a resizable Div?


I'm using resizable Divs. When the user adds a new Div, I need to
check and possibly change the maxHeight limit of any existing Divs to
block them being resized over the new one.
At page load I calculate all the maxHeight values and they are defined
via the Ready() function. At that point all is fine.
When a new one is added, the following happens for each Div (including
the new one, hence the attempt to work out which has maxHeight
defined). Unfortunately that check isn't working.
Also is it possible to add a new resizable callback on the fly like
this?
var max=dParams[1];
var maxH=typeof ($('#'+dParams[0]).data('maxHeight'));
if (maxH =='undefined')
{
$('#'+dParams[0]).resizable({handles: 's',    grid: [19,19], minHeight:
38, maxHeight:max,
start: function(e, ui) {},
stop: function(e, ui) { adjustBooking($(this),e,ui);},
resize: function(e, ui) {} });
}
else
$('#'+dParams[0]).data('maxHeight',max);