- I am looking at the DD resizable panel example

http://developer.yahoo.com/yui/examples/dragdrop/dd-resize_clean.html

and I can't figure out how to limit the panel from being resized to a

certain size. For example I don't want my panel to become any smaller

than 100x100 or any larger than 300x300. How can this be achieved? - That's easy. In onDrag function, change these two lines:

var newWidth = Math.max(this.startWidth + offsetX, 10);

var newHeight = Math.max(this.startHeight + offsetY, 10);

to

var newWidth = Math.min(Math.max(this.startWidth + offsetX, 100), 300);

var newHeight = Math.min(Math.max(this.startHeight + offsetY, 100), 300);On Feb 1, 2008 10:06 AM, varnit <varnit@...> wrote:I am looking at the DD resizable panel example

http://developer.yahoo.com/yui/examples/dragdrop/dd-resize_clean.html

and I can't figure out how to limit the panel from being resized to a

certain size. For example I don't want my panel to become any smaller

than 100x100 or any larger than 300x300. How can this be achieved?

- Thanks Jing, you rock!

-varnit----- Original Message ----

From: Jing Ceawlin <zjply4000@...>

To: ydn-javascript@yahoogroups.com

Sent: Thursday, January 31, 2008 9:39:59 PM

Subject: Re: [ydn-javascript] Limit DD resizeThat's easy. In onDrag function, change these two lines:

var newWidth = Math.max(this. startWidth + offsetX, 10);

var newHeight = Math.max(this. startHeight + offsetY, 10);

to

var newWidth = Math.min(Math. max(this. startWidth + offsetX, 100), 300);

var newHeight = Math.min(Math. max(this. startHeight + offsetY, 100), 300);On Feb 1, 2008 10:06 AM, varnit <varnit@yahoo. com> wrote:I am looking at the DD resizable panel example

http://developer. yahoo.com/ yui/examples/ dragdrop/ dd-resize_ clean.html

and I can't figure out how to limit the panel from being resized to a

certain size. For example I don't want my panel to become any smaller

than 100x100 or any larger than 300x300. How can this be achieved?