Created
June 22, 2015 08:50
-
-
Save VitaliyR/0df0f9b691c6a6b6aa26 to your computer and use it in GitHub Desktop.
Extend jQuery plugin
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
(function($) { | |
/** | |
* Namespace: the namespace the plugin is located under | |
* pluginName: the name of the plugin | |
*/ | |
var extensionMethods = { | |
/* | |
* retrieve the id of the element | |
* this is some context within the existing plugin | |
*/ | |
showId: function(){ | |
return this.element[0].id; | |
} | |
}; | |
$.extend(true, $[ Namespace ][ pluginName ].prototype, extensionMethods); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment