我试图创建一个jQuery插件如何创建扩展jQuery函数
最初的插件使用像
$('element').plugin;
现在,我想进一步扩展它调用特定操作,如
$('element').plugin.create;
或
$('element').plugin.delete;
这样做的任何方式?
我试图创建一个jQuery插件如何创建扩展jQuery函数
最初的插件使用像
$('element').plugin;
现在,我想进一步扩展它调用特定操作,如
$('element').plugin.create;
或
$('element').plugin.delete;
这样做的任何方式?
这似乎是你想创建一个小部件。看看这里的什么部件做,而不是插件一个很好的解释:http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/通常情况下,你会然后调用插件的方法是这样的:阅读$('element').plugin('create')
通过对插件的创建this伟大的教程由贾斯汀·迈耶