Created
February 23, 2015 00:19
-
-
Save devdays/2f36e0a06d51f969074c to your computer and use it in GitHub Desktop.
Setting and using options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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 //.. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#myParagraph").footnote({ | |
color: "orange", | |
referencesLocation: "#theReferences" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment