In order to clean up my code i want to use sub-plugins within my actual jQuery plugin, but actually there is nothing happening. thx in advance
As an easy example, please take a look at the following code:
(function($){
$.fn.funct = function() {
// so far it seems to run the code...
console.log('funct is running...');
return this.each(function(){
// ...but nothing is happening here
console.log('this.each is running...');
$(this).css('background', 'blue');
}
}
$.fn.foo = function() {
return this.each(function(){
console.log('plugin is running...');
$(this).funct();
});
};
})(jQuery);