[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-25 Thread howardk
I went back to scratch and did up a simplified rewrite of my plugin. I haven't found the problem with the actual plugin yet, but at least now I know how the architecture is *supposed* to work. Chaining doesn't come into it (as suggested by Sean), but the test code at

[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread Shawn Grover
Depends how your plugin is set up. If you didn't implement the chaining techniques, then chances are you only have one instance. But if you did implement chaining, you *should* have multiple instances. Do you have something like this line in your plugin? return $(this).each( function () {

[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread Michael Geary
You may be worried about a problem that doesn't exist. Every time you call a function, JavaScript creates a new, unique set of local variables for that invocation of the function. It doesn't reuse the same function invocation and its local variables over and over again. Now, you *could* write

[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread howardk
Michael and Sean, Thanks to both of you. I think I'll take you up on your offer of posting some (simplified) code. Sometime tomorrow if I can find the time for it ... Thanks again, Howard On Nov 24, 3:49 pm, Michael Geary [EMAIL PROTECTED] wrote: You may be worried about a problem that doesn't