JQUERY – Création de plugin

I► Dans cet article, nous allons voir comment créer un plugin JQuery afin de pouvoir ré-exploiter son code.

Un plugin JQuery se construit comme ci-dessous :

(function($) {

$.fn.NomDuPlugin = function(options) {

var defaults = {
propriété1 : xxxxx ,
propriété2: “xxxx”
};

}
})(jQuery);

Exemple :

Capture

 

Michel BOCCIOLESI