开发者

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')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜