Wednesday, October 03, 2007

Resizing with YUI

Here's a really simple example of using YUI's Drag and Drop component to build a resizer. It's not a reusable component, but you'll see just how little JavaScript you need to do something like this.

Here's the example --

The JavaScript looks like --

I'm using YUI 2.3, but the version really shouldn't matter.

The HTML is even simpler --

and then we style it with some CSS --

That's all there is to it. This illustrates how you can use YUI's "helper" components to enhance your application.

Use and enhance this example as much as you like.
Have fun!

No comments: