[jQuery] Problem with namespacing plugins
Hi, I have a a problem that I don't really know how to take care of.
I want to do something like this
$.fn.myNamespace = {
myVar : 'test'
};
$.fn.myNamespace.myFunction = function(options) {
return this.each(function(){
console.log(this)
});
};
$('div').myNamespace.myFunction()
But this aint chainable, which is my problem. Because what I really
would like to do is to have a collection of plugins to the myNamespace
object...like this
$('div').myNamespace.myFunction1()
$('div').myNamespace.myFunction2()
$('div').myNamespace.myFunction3()
$('div').myNamespace2.myFunction1()
$('div').myNamespace2.myFunction2()
$('div').myNamespace2.myFunction3()
Help would be appriciated.
Thanks.