开发者

How to create extend a jquery function

开发者 https://www.devze.com 2023-01-20 09:38 出处:网络
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

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

精彩评论

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