2011-05-12 35 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