Maybe the problem is from attaching your 'options' property to the
jQuery object? I've been storing an element's options in an array and
just attach the index integer (or 'serial') to the DOM element so you
can then do something like this to retrieve an element's unique
options object:

var myOpts = $.fn.myPlugin.optionsArray[this.serial]; /*

However, this is just something I worked out for myself due to not
really knowing a better way of being able to have separate options
objects for separate elements that I apply a plugin to. I think a
better way might be to just attach the options object to the DOM
element directly by using jQuery's inbuilt $.data function like this:

$.data(this, 'myOpts', optionsObject); /*assign options object to the
DOM element*/
$.data(this, 'myOpts').onIni(); /*retrieve options object and call a
function from it*/

I think the point of using $.data instead of just this.options is to
get around memory leak issues with assigning expandos to DOM elements,
but I'm not sure. Maybe someone else can shed more light on this stuff
as I am fairly unclear about it myself.

Joel Birch.

Reply via email to