$.fn.testplugin = function (options) {
// make app var for use in plugin
$.that = this;
// change plugin info
var settings = $.extend({
data: [],
title: 'Main category'
}, options);
...code
});
});
// use
$("#test1").testplugin({'title':'AAAA'});
$("#test2").testplugin({'title':'BBBB'});
all title is BBBB :( why ? how can I fix it?
Lots of things wrong here
Seems like the IIFE isn't being called either
Обсуждают сегодня