Last active
July 24, 2018 01:20
-
-
Save gilbertoquinteroA/b9f6efac9fa39b98377e7bf4ecc4d1d2 to your computer and use it in GitHub Desktop.
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
/* | |
https://www.ostraining.com/blog/coding/custom-jquery-plugin/ | |
my first plugin in Jquery | |
*/ | |
(function ($) { | |
$.fn.hello = function (options) { | |
//Default options | |
var myname = $.extend({ | |
name: 'Gilbert' | |
color: 'green' | |
}, options ); | |
//Appy options | |
return this.append('hello ' + myname.name + '!'.css({ color: myname.color }); | |
}; | |
}( jQuery )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment