[jQuery] Re: Plugin Authoring Help pt 2

2008-03-05 Thread Danny
By the way, you'll have trouble if you use defaults like this: $.fn.myPlugin1 = function(options) { var myOptions = $.extend(defaults, options); since that will actually extend the defaults object and your defaults will be changed whatever was in options for the next time you use the plugin.

[jQuery] Re: Plugin Authoring Help pt 2

2008-03-05 Thread jquertil
ugh, I' min the same boat. I hope some of the superstars will eventually get around to writing more detailed tutorials. been struggling with extension writing myself. On Mar 4, 11:09 am, Leanan [EMAIL PROTECTED] wrote: Ok, I'm really trying to wrap my head around this, and it's irritating me.

[jQuery] Re: Plugin Authoring Help pt 2

2008-03-05 Thread J Moore
You might find it easier to simply create objects that use jquery, instead of writing a jquery plugin. The biggest advantage is that you actually have a normal instance of an object. You can pass this instance to other objects, call other methods on it... all the usual good stuff. (jquery

[jQuery] Re: Plugin Authoring Help pt 2

2008-03-05 Thread Chris Jordan
J, I for one sure hope that someone follows up on your particular thoughts here. I've not thought of doing what you're talking about here, and I'd love to read other experts opinions on the subject. Thanks for adding to this thread. :o) Chris On Wed, Mar 5, 2008 at 8:57 AM, J Moore [EMAIL

[jQuery] Re: Plugin Authoring Help pt 2

2008-03-04 Thread Mike Alsup
If you want to use two different functions in the chain then you need to define two plugin functions: // wrap it all in a closure so you can share private data easily (function() { $.fn.myPlugin1 = function(options) { var myOptions = $.extend(defaults, options); // do stuff };