Skip to content

there is a wrong place here, http://learn.jquery.com/plugins/basic-plugin-creation/ #310

Closed
@liuwuyue

Description

@liuwuyue

(function ( $ ) {

$.greenify = function( options ) {

// This is the easiest way to have default options.
var settings = $.extend({
  "color": "#556B2F",  // These are the defaults
  "background-color": "white"
}, options );

// Greenify the collection based on the settings variable
return this.css({
  "color": settings.color,
  "background-color": settings.background-color
});

};
}( jQuery ));

$("div").greenify({
"color": "orange"
});

here , it should be $.fn.greenify

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions