vendredi 19 février 2016

JQuery plugin does not change value of pass parameters in my plugin

Jquery plugin is not accepting parameters that I pass using like this:

$("p").myplugin({ foo:bar,foo1: bar1});

For example my plugin like this :

$.fn.myplugin= function (parms){ 
    var def = {foo : "foo1",foo2 : "foo4"}; 
     var set = $.extend({true, def,parms});
   // do stuff 
   return this; 
}

So problem is value of foo is not changing to bar, it always: foo1. How can I solve this problem?

My original Plugin :

Here I snippet my original plugin in js fiddle: textBarEditor plugin




Aucun commentaire:

Enregistrer un commentaire