So this is most likely a very simple problem which i just can’t figure out.
Basically i want to select multiple elements and create new instance for each object.
Then later on i want to be able call public methods from outside plugin.
Now the problem is that when i call those methods i can’t seem to access each instance settings, well i can, but it looks like those settings are overridden when looping trough elements.
I think i won’t post code here since it’s quite long, but i have made this jsfiddle, and i have explained what doesn’t work in the comments.
Just to be clear, plugin is called two times, then i call public method called test which should set this text container to .result div but it sets container2 which is incorrect.
You need to attach data to dom element inside
init$.data(obj, “settings”, settings);
You better call method in context of dom element
methods[method].apply(this, options);
http://jsfiddle.net/5EGEY/1/