(function($) {
$.fn.funName = function(options) {
var defaults = { choose: 'red', out: '#000' }
var options = $.extend(defaults, options);
return this.each(function() {
var $this = $(this);
$this.css('color', options.choose).siblings().css('color', options.out);
});
}
})(jQuery);
$(function() { $('#demo').funName({'choose':'green', 'out':'#f00'}); });
|