在公司项目过程中开发过几个插件,下面为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 插件模板 制作jquery插件的朋友可以参考下的全部内容,更多相关JQuery内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复