This topic created in 3701 days ago, the information mentioned may be changed or developed.
插件类似
(function ( $ ) {
$.fn.greenify = function( options ) {
// This is the easiest way to have default options.
var settings = $.extend({
// These are the defaults.
color: "#556b2f",
backgroundColor: "white"
}, options );
// Greenify the collection based on the settings variable.
return this.css({
color: settings.color,
backgroundColor: settings.backgroundColor
});
};
}( jQuery ));
/* Example usage */
$( "div" ).greenify({
color: "orange"
});
在已初始化后,如何再修改“ backgroundColor ”的值?
1 replies 2016-03-11 12:21:24 +08:00  | | 1 jwk345 Mar 11, 2016 via iPhone $("div").greenify("bacgroundColor","#aaaaaa"); 这样吧 |