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);
官方模板制作手冊
復(fù)制代碼 代碼如下:
; (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實現(xiàn)搜索關(guān)鍵字自動匹配功能
這篇文章主要介紹了基于jQuery實現(xiàn)搜索關(guān)鍵字自動匹配功能,自動匹配搜索關(guān)鍵詞功能廣泛應(yīng)用到搜索引擎當(dāng)中,感興趣的小伙伴們可以參考一下2015-10-10jquery 實現(xiàn)兩級導(dǎo)航菜單附效果圖
兩級導(dǎo)航菜單在網(wǎng)頁中非常實用,實現(xiàn)的方法也有很多,本文為大家介紹下使用jquery是如何實現(xiàn)的2014-03-03jQuery源碼解讀之a(chǎn)ddClass()方法分析
這篇文章主要介紹了jQuery源碼解讀之a(chǎn)ddClass()方法,注釋形式較為詳細的分析了addClass()方法的實現(xiàn)技巧與相關(guān)注意事項,具有一定參考借鑒價值,需要的朋友可以參考下2015-02-02基于jquery的禁用右鍵、文本選擇功能、復(fù)制按鍵的實現(xiàn)代碼
有時候因為某些原因,需要禁止用戶的右鍵、文本選擇功能、復(fù)制按鍵等操作,那么就可以參考下面的代碼2013-08-08