A usual technique for having variables local to a plugin is to use function
scoping like this:
(function($) {
var firstVar = ...;
var secondVar = ...;
$.pluginFunction = function() {
...
};
})(jQuery);
2009/4/12 Alexandre Marinho <[email protected]>
>
> Hi, i'm tring to reproduce a library of mine from Prototype to JQuery.
> It's a script to animate images in a container with a few effects...
> but I'm having some troubles with plugin local variables.
>
> The thing is that is working only when there is one container, with
> more than one the variables are mixed specially the timeout. That
> doesn't happen with Prototype because it uses OO pattern which makes
> things a lot easier.
>
> Here is my code: http://dpaste.com/32327/
>
> I've spent the last two days trying to do that. Is there a better way
> to do that?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---