问题
Possible Duplicate:
Jquery resizable plugin, set minWidth depending on the dragging edge
How can i set the minWidth and height depending on which edge of the element is being dragged?
回答1:
Kind of a weird interaction, but here it is (jsfiddle)
$(function() {
$( "#resizable" ).resizable({
handles : 'e, n, s, w',
resize : function(event, ui){
switch($(this).data('resizable').axis)
{
case 'n':
$(this).resizable( "option", "minHeight", 75 );
break;
case 's':
$(this).resizable( "option", "minHeight", 100 );
break;
case 'e':
$(this).resizable( "option", "minWidth", 150 );
break;
case 'w':
$(this).resizable( "option", "minWidth", 200 );
break;
}
}
});
});
来源:https://stackoverflow.com/questions/10775703/jquery-resize-plugin-min-width-depending-on-which-edge-is-being-dragged