How to create extend a jquery function
I'm trying to create a jquery plugin
initially the plugin is used like
$('element').plugin;
Now, i want to extend it further to call specific operations like
$('e开发者_如何学Golement').plugin.create;
or
$('element').plugin.delete;
any way of doing this?
Read through this great tutorial on plugin creation from Justin Meyer
That seems like you want to create a widget. Look here for a good explanation of what widgets do as opposed to plugins: http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/ Typically, you would then call your plugin's methods like this: $('element').plugin('create')
精彩评论