![]() |
1
2
如果希望这些方法在任何jquery对象上都可用,则必须将它们中的每一个都添加到jquery的原型中。原因是每次你打电话
将每个方法分配给jquery的原型,如下所示:
这个
您也可以使用
一个更好的方法是你的插件的命名空间
Or save a reference to the returned object the first time, and call methods on it directly.
|
![]() |
2
2
I found this solution here: http://www.virgentech.com/blog/2009/10/building-object-oriented-jquery-plugin.html This seems to do exactly what I need.
然后我有
我可以用
由于构造函数
|
![]() |
3
0
注意,您将重写jQuery的本机。
而且,就其价值而言,我认为这不是一个好主意。jQuery instances are assumed to only have methods inherited from jQuery's prototype object, and as such I feel what you want to do would not be consistent with the generally accepted jQuery-plugin behaviour -- i.e. return the
|
![]() |
Rational Redneck · Java结构化方法链接 2 年前 |
![]() |
KianQ · 如何从数组生成SQL Update语句 2 年前 |
![]() |
AJA SMBAT · 我在获取列表而不是绑定方法时遇到问题 2 年前 |
![]() |
dsdsds sdsds · .pop()从原始列表中删除元素[重复] 2 年前 |
![]() |
MatÄj VondráÄek · 如何在c#方法中传递类型? 2 年前 |
![]() |
AISAN · 找不到令人兴奋的符号?[重复] 2 年前 |