Afin de nettoyer mon code, je veux utiliser des sous-plugins dans mon plugin jQuery, mais en réalité rien ne se passe. thx à l'avanceAppel d'autres plugins dans un plugin jQuery
À titre d'exemple simple, s'il vous plaît jeter un oeil sur le code suivant:
(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);
Wow, bonne prise! –