2011-05-12 34 views

回答

4

最簡單的方法是隻創建一個插件:

$.fn.myproperty = function (opts) { 
    // within the plugin: 
    // this === $('#selector') 
    // opts.para1 === val1 
}; 

,當你調用它使用$('#selector').myproperty({para1:val1})

+0

感謝名單哥們它的工作 – Tuscan 2011-05-12 06:13:41