Reputation: 448
I have a div which is resizable from the left (w) and the right (e) using jQuery UI. Resizing on the right works perfectly, but on the left two things behave different:
I made this fiddle
$("#test").resizable({
handles: 'e,w',
grid: 32,
maxWidth: null,
minWidth: 0
});
Why is that so?
Thanks
Edit Grid 32 is needed, but you are right, it would work without.
Upvotes: 0
Views: 103
Reputation: 448
I found a solution.
I overwrite jQuery UI's $.ui.plugin.add("resizable", "grid")
on resize start
.
Not the best solution I think but it works.
Here you can see the changes I made in the last if-else
:
Old:
if ( newWidth - gridX > 0 ) {
that.size.width = newWidth;
that.position.left = op.left - ox;
} else {
that.size.width = gridX;
that.position.left = op.left + os.width - gridX;
}
Customised:
if ( newWidth - gridX >= 0 ) {
that.size.width = newWidth;
that.position.left = op.left - ox;
} else {
that.size.width = o.minWidth;
that.position.left = op.left + os.width - gridX;
}
Upvotes: 0