OOP for your jQuery plugins.
- allows You to write true OOP code to use as your jQuery plugins
- stores a plugin instance in jQuery.data for every selected element, once instantiated the plugin will remain there for further use
- unlike original jQuery, plugin methods work for all selected elements (not only for the first one)
- but You decide if You want to provide chaining or not
Common use case (with chaining)
ploogins.register(YourPluginName); var plug = $('.someClass').YourPluginName(); plug.someMethod().css('color', 'red');
https://github.com/krzyzak00 - for borrowing his inheritance mechanism and helping with bugfixes
https://github.com/Sahadar - for providing good ideas
Licensed under the MIT license.