Is it possible to execute all the functions of a namespace with one call?
Exp:
var myApp = {
e : $('.js-box'),
addStyle : function(){
myApp.e.css('height','200');
},
warn : function(){
alert('WOOOOOoooOO');
}
};
myApp.addStyle();
myApp.warn();
It works correct with the code above..
Can we fire addStyle and warn functions with one call?
What I have tried/thought:
var myApp = {
workAll : function(){
e : $('.js-box'),
addStyle : function(){
myApp.e.css('height','200');
},
warn : function(){
alert('WOOOOOoooOO');
}
}
};
myApp.workAll();
this doesn't work anything.. How can I do something like that?
Live try: http://jsfiddle.net/C7JJM/82/
Thank you in advance!