I've a jQuery plug-in that operates on some ULs, adding and removing classes etc.
During the life-cycle of the page, I'll need to add/ remove some classes in code, and as my plug-in needs to perform some additional operations when this happens I came up with the following:
// This is the initialiser method...
$.fn.objectBuilder = function (options) {...};
// These are the two new methods I need.
$.fn.objectBuilder.setSelected(element) {...};
$.fn.objectBuilder.removeSelected() {...};
I'd then like to call them like this:
$("#ob1").objectbuilder.removeSelected();
Any thoughts?
Thanks, Kieron
edit
I suppose what I'm asking is, whats the best way of adding additional methods to a jQuery plug-in where it'll have access to the root object, in this case #obj when the method is called.