jQuery delegates with plugins -


The jQuery rep is very good, especially when using tables with line click events.

I was thinking that it is possible to use delegates along with the plug-in as well? For example, if I attach elastic plug-ins to each text area, then I do:

  $ ("textarea") .elastic ();  

But how do I use this plug-in representative?

You can cheat OK, you can do this in the example.

You need a representative-enabled event that always requires the implementation of the plug-in and before knowing whether it has already happened or not, there is some meaning to know. After that, to always / have to focus on Texter before typing, you can do this:

  $ ('textarea'). Live ('focus', function () (if (! $!). Data ('islastic')) $ (this). Data ('islstick', true). Flexible ();})  

I'm assuming you're running at least jQuery 1.4.


Comments