JQuery 插件模板 制作jquery插件的朋友可以参考下
更新时间:2010年03月17日 20:17:08 作者:
JQuery 插件模板 制作jquery插件的朋友可以参考下
在公司项目过程中开发过几个插件,下面为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);
官方模板制作手册
复制代码 代码如下:
; (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和Js中,如何让ajax执行完后再继续往下执行
查了不少资料,最后,还是jquery指南的书上找到了详细的参数(async: false,),做好后,示例代码放上,如下所示,需要的朋友可以参考下2013-07-07
jquery showModelDialog的使用方法示例详解
这篇文章主要介绍了window.showModalDialog的使用方法,大家要以参考使用2013-11-11


最新评论