JQuery 插件模板 制作jquery插件的朋友可以參考下
更新時間:2010年03月17日 20:17:08 作者:
JQuery 插件模板 制作jquery插件的朋友可以參考下
在公司項目過程中開發(fā)過幾個插件,下面為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);
官方模板制作手冊
相關(guān)文章
探討在JQuery和Js中,如何讓ajax執(zhí)行完后再繼續(xù)往下執(zhí)行
查了不少資料,最后,還是jquery指南的書上找到了詳細的參數(shù)(async: false,),做好后,示例代碼放上,如下所示,需要的朋友可以參考下2013-07-07
jQuery實現(xiàn)響應(yīng)鼠標背景變化的動態(tài)菜單效果代碼
這篇文章主要介紹了jQuery實現(xiàn)響應(yīng)鼠標背景變化的動態(tài)菜單效果代碼,涉及jquery鼠標mouseover事件操作頁面元素屬性的相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-08-08
jquery showModelDialog的使用方法示例詳解
這篇文章主要介紹了window.showModalDialog的使用方法,大家要以參考使用2013-11-11

