Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/htanjo/jquery-plugin-interface
Simple interface for creating jQuery plugin.
https://github.com/htanjo/jquery-plugin-interface
Last synced: about 1 month ago
JSON representation
Simple interface for creating jQuery plugin.
- Host: GitHub
- URL: https://github.com/htanjo/jquery-plugin-interface
- Owner: htanjo
- Created: 2011-09-07T16:24:26.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-09-21T00:42:03.000Z (over 12 years ago)
- Last Synced: 2023-03-23T17:52:53.195Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 246 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery.plugin-interface.js
==========================This is a simple interface for creating jQuery plugin.
Usage
-----
```javascript
$.plugin( object );
```#### Options
* `object.name` : Plugin name
* `object.parent` : Superclass plugin (optional)
* `object.defaults` : Default options object
* `object.methods` : Instance methods objectExample
-------
You can easily define a jQuery plugin with this interface.#### Definition
$.plugin({
name: 'myPlugin',defaults: {
foo: 'bar'
},methods: {
initialize: function () {
// Constructor
},myMethod: function (param1, param2) {
// Plugin instance method
}
}
});#### Use plugin
$('#myElement').myPlugin();
// Call plugin method at any time.
$('#myElement').myPlugin('myMethod', ['Hello', 'World']);