PDA

View Full Version : How to I use YUI / YUI-Ext?



phpguy
26 Nov 2006, 6:33 PM
Yeah, I have no idea where to get started and I'm having a lot of trouble finding a quick guide. I really have little knowledge of JavaScript...just enough to get by doing basic DOM manipulation and AJAX stuff, and I really don't know the JavaScript syntax too well (especially when it comes to objects).

I'm trying to use the resizable class to allow a user to resize a simple div. Then I need to retrieve the dimensions of the element and submit them when the user clicks the next page button (just a simple form with hidden fields does the trick fine). This will be used to allow a user to specify the size of an image they are creating (done all in PHP).

I can get the basic resize div to display and, well, resize. I understand how to set the options and such as well. My main problem is that I can't get it to display the image handles. I looked through the yui-ext.js code to see if I could figure out where it's trying to pull the handle images from to no avail. My second problem is going to be determining the width and height of the div.

Any help is GREATLY appreciated.

EDIT: I suppose I should also mention that I'm pretty confused on what files to and not to include. I more or less just copied the example page and cut out everything but the basic box, then modified basic.js with the options I needed. If I did something to sigh in disappointment over, please let me know.

jack.slocum
27 Nov 2006, 5:58 AM
Have you included resizable.css? Are the images in resources/images/sizer deployed?

As for getting the size, there's an event "resize" that will tell you when the user resizes the element.