Skip to content

Instantly share code, notes, and snippets.

@devdays
Created February 23, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/2f36e0a06d51f969074c to your computer and use it in GitHub Desktop.
Save devdays/2f36e0a06d51f969074c to your computer and use it in GitHub Desktop.
Setting and using options
$.fn.footnote = function (options) {
// This is the easiest way to have default options.
var settings = $.extend({
// These are the defaults.
color: "blue",
referencesLocation: "#references"
}, options);
// use the options
$(settings.referencesLocation).css("color", settings.color);
//
return //..
}
$("#myParagraph").footnote({
color: "orange",
referencesLocation: "#theReferences"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment