lorenos lorenos - 6 days ago 5
HTML Question

How to resize every time for the same pixel value e.g.("10px") with jquery-ui?

I wonder if there is any way to resize a

div
element for the same pixel value every time when i wanna resize the
div
element e.g.("10px"). I'm trying to do it with jquery-ui, i can resize but i wanna resize it every time for some pixel value, and with the same value reduce it.

$(children[0]).resizable({
handles: "e, w"
});


I'm doing it with resizable.
Anyone know if there is a way to do it?

Thanks.

Answer

I don't know if I got the question right, but I think you just need to use the grid param as such:

$( "#resizable" ).resizable({
  grid: 10
});

You can find the documentation here