Exos Exos - 1 year ago 101
Javascript Question

jQuery plugin access

I'm doing a youtube player in jQuery, and I make this as a jQuery plugin, ex:


uplayList: {},

CreateUplayList: function (options) {
this.each(function () {
$(this).uplayList = new $.playList(this, options);

But, if I do:


And I want access at the instance:


This not work, that make sense, because $('#playlist') is a selector. I see in others plugins something like that:


How can I apply this??

Answer Source

See the "Adding Methods to a Widget" section of the "Stateful Plugins" section of the jQuery Plugin Authoring Guide.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download