开发者

Applying multiple jQuery plugins

开发者 https://www.devze.com 2023-04-09 00:52 出处:网络
I have made two jquery plugins which both work in their own right. If I call them using: $(\'input\').inputShrink();

I have made two jquery plugins which both work in their own right.

If I call them using:

$('input').inputShrink();
$('input').fillForm();
开发者_运维百科

then the two effects work. However, if I do:

$('input').inputShrink().fillForm();

then only the first one is applied. It was my understanding you could do this, is there something in my plugins I need to set up?


Quote from the jQuery docs : LINK

Maintain chainability in a plugin, you must make sure your plugin returns the thiskeyword.

In short - remember to return the jQuery object in your plugin.

0

精彩评论

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

关注公众号