Home / یک تمپلت برای ایجاد plugin jquery

یک تمپلت برای ایجاد plugin jquery


برگرفته از سایت
http://starter.pixelgraphics.us/
(
function($){ $.pluginname = function(el, param1,param2, options){ // To avoid scope issues, use 'base' instead of 'this' // to reference this class from internal events and functions. var base = this; // Access to jQuery and DOM versions of element base.$el = $(el); base.el = el; // Add a reverse reference to the DOM object base.$el.data("pluginname", base); base.init = function(){ base.param1,param2 = param1,param2; base.options = $.extend({},$.pluginname.defaultOptions, options); // Put your initialization code here }; // Sample Function, Uncomment to use // base.functionName = function(paramaters){ // // }; // Run initializer base.init(); }; $.pluginname.defaultOptions = { }; $.fn.pluginname = function(param1,param2, options){ return this.each(function(){ (new $.pluginname(this, param1,param2, options)); }); }; })(jQuery);



     RSS of this page