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.
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.
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
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
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
};
5 matches
Mail list logo