@Rey, Yeah, Glen finally hassled me enough to post this :) I will try to be more active on it going forward.
@Josh, Thanks for the feedback. I wasn't sure if the THIS scope was bad to use since it pointed to the jQuery object itself. But I guess, the whole point of the plugin is that you are extending the very nature of the jQuery object. Yeah, I am a vertical coder. The less I have to scroll horizontally, the easier my code is to read (to me). Plus, as you can see, I love to put in comments, especially when posting for other people to view. My actual code has less comments. Thanks for the help. -Ben On 7/2/07, Josh Nathanson <[EMAIL PROTECTED]> wrote:
Hey Ben, That all looks really good, and it's fun to play with! People on this list who are not familiar with your coding style will probably trip out on its "verticality", since because of jQuery's chainability, it tends to get quite horizontal. It would be cool if you added a little "got me!" alert if the user is able to click on the button (that happens sometimes when it doesn't jump away very far). -- Josh ----- Original Message ----- *From:* Ben Nadel <[EMAIL PROTECTED]> *To:* [email protected] *Sent:* Monday, July 02, 2007 3:00 PM *Subject:* [jQuery] jQuery plugin architecture info Hey all, I am really starting to get into programming some jQuery stuff. I love what I see so far, but I want to get into programming some plugins. I have read the getting started with plugin info on the jQuery site and I am slowly coming around. I have thrown together my first plugin, which seems to work, but I wanted to get some feedback on it: http://www.bennadel.com/blog/800-My-First-jQuery-Plugin.htm The way it works is the function defined event handlers in the THIS scope of the jQuery object. Then, it binds events to those already-defined methods (as the event handlers). I am not sure if this is good to do because it alters the structure of the jQuery object itself. However, I am hesitant to define an anonymous function inside of the BIND methods as that will duplicate the event handler for each element in the jQuery stack (which seems hugely wasteful, unless I am totally missing something). This seemed like the best way to get around not having a prototype method shared among all the jQuery stack elements. Thanks. Please let me know if I am WAAAY off base or maybe on the right track. All feedback is appreciated. jQuery rocks :) -Ben -- Ben Nadel Certified Advanced ColdFusion Developer http://www.bennadel.com
-- Ben Nadel Certified Advanced ColdFusion Developer http://www.bennadel.com

