Chris
Chris

Reputation: 2646

Applying multiple jQuery plugins

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?

Upvotes: 0

Views: 62

Answers (1)

cillierscharl
cillierscharl

Reputation: 7117

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.

Upvotes: 1

Related Questions