Is there a way of instantiating multiple instances of a plugin on the
same page?

What I have essentially is an animated effects plugin, and I want to
be able to invoke separate instantiations of it, doing something like
the following:

<script>
        $( '#effect_1' ).animEffect( { name: 'jumper', color: 'ff0000', fps:
30 } );
        $( '#effect_2' ).animEffect( { name: 'round-the-moon', color:
'ffff00', fps: 40 } );
</script>

<div id='effect_1'></div>
<div id='effect_2'></div>

I'm still fairly new to javascript. As far as I can tell though, it
looks like it can't be done, since as far as I can see, each plugin
invocation is really calling the same function object over and over
again (thereby overwriting whatever instance or local variables might
have been set in a prior invocation).

Is this correct? Is there a way of doing this, or am I out of luck?
Howard

Reply via email to