I would specify different maximum constraint on a resizable div.
For example, I want a maximum resize of 20px in north direction and 200px in south.
I can easily do it for only one direction with maxHeight and by restricting the handle to one direction, but I can’t manage the both at the same time.
Is it absolutely impossible ?
Please, jQuery and jQuery UI are not the same.
jQuery UI resizable widget gives you a set of options. One of them is maxHeight as you noticed, but there is also minHeight. And of course the equivalents for width.
If you have a fixed height item (100px), you can simply use this code to have 20px north and 200px south :
Now if you do not know its variable height, you can always find it out with jQuery:
And even better, if you’d like to be able to resize it with steps of 20px/200px, you could try using the stop event :
Now if you want to increase its height with two different handles but have separate limits, you could use the class of the handle to force another limit :
If you do not want the element to be resized smaller later on, you can also add something like that in your stop event: