December 3, 2010

jQuery resizable plugin, to resize only height

Question by Goppie TOp

How to make alsoResize option to only work for height but not for both width and height?

Answer by Starx

Actually if you set maxWidth to a limit, we cannot resize the width more than it.

For example,

$( ".selector" ).resizable({ maxWidth: 250 }); //For initialzation 

will not allow the resize to occur more that 250px in width

If you check this demo
http://jqueryui.com/demos/resizable/#max-min, you will notice the width resizing being limited to a point.

So in your case set the initial width of the .selector and maxWidth same and it is done.

For further information go to http://jqueryui.com/demos/resizable/#option-maxWidth

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!