在公司项目过程中开发过几个插件,下面为Levin所用的JQuery插件模板。和google上的大同小异哈。
复制代码 代码如下:
; (function($) {
// Private functions.
var p = {};
p.func1 = function() { };
//main plugin body
$.fn.PLUGIN = function(options) {
// Set the options.
options = $.extend({}, $.fn.PLUGIN.defaults, options);
// Go through the matched elements and return the jQuery object.
return this.each(function() {
});
};
// Public defaults.
$.fn.PLUGIN.defaults = {
property: 'value'
};
// Public functions.
$.fn.PLUGIN.method1 = function(skinName) {
return;
};
})(jQuery);
官方模板制作手册
您可能感兴趣的文章:
- jquery.tmpl JQuery模板插件
- Json2Template.js 基于jquery的插件 绑定JavaScript对象到Html模板中
- JQuery模板插件 jquery.tmpl 动态ajax扩展
- Jquery 模板数据绑定插件的使用方法详解
- 常用的jquery模板插件——jQuery Boilerplate介绍
- 推荐一款jQuery插件模板